I have a dropdown in a rails form:
<%= f.select :lists, [[\"test1\", 1], [\"test2\", 0]] %>
This works fine but how can I make it dynamic
You can use options_from_collection_for_select.
<% options = options_from_collection_for_select(@list, 'id', 'name') %> <%= f.select :all_val, options %>