4 ms·
I really like Elm. It makes writing code so easier. At first, it's bit hard to get into the habit. But once I got paste that state(that takes 1-2 days) and get
by kureikain 9y ago
I really like Elm. It makes writing code so easier. At first, it's bit hard to get into the habit. But once I got paste that state(that takes 1-2 days) and get into how to write Elm, everything become so clear.
I currently use Rails and this helper[1] to render an Elm component. Then I mount it like this: [2]
```
<%= elm_component('TeamPicker', {flags: {
formAuthenticityToken: form_authenticity_token,
domain: current.domain,
teams: user.my_teams.map { |team| {id: team.id.to_s, name: team.name || ""} },
current_team: {id: current.team.id.to_s, name: current.team.name || ""}
}}, {tag: 'div', class: "nav-item"}) %>
```
I think this is an easy way to get into Elm world step by step.
My site is still normal HTML but I used ELM here and there
for some component require interaction/multi step form etc.
---
[1]: https://github.com/NotyIm/trinity/blob/master/app/helpers/elm_helper.rb https://github.com/NotyIm/trinity/blob/master/app/helpers/el...
[2]: https://github.com/NotyIm/trinity/blob/master/app/views/partials/dashboard/_header.html.erb#L46-L52 https://github.com/NotyIm/trinity/blob/master/app/views/part...