Reputation: 1323
The options_for_select form helper in Rails builds a drop-down list collection with a pre-selected value like this:
<%= options_for_select([['Lisbon', 1], ['Madrid', 2], ...], 2) %>
What's the equivalent in HAML?
Upvotes: 1
Views: 1788
Reputation: 34072
lose the enclosing <% %>
and just leave the =
?
<%= whatever %>
becomes
= whatever
Just note the indentation is correct, of course.
Upvotes: 4