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
This worked for me
# view <%= form.select(:list_id) do %> <% @list.each do |l| -%> <%= content_tag(:option, l.name, value: l.id) %> <% end %> <% end %>
and
# controller @list ||= List.all
`