Home Select multiple options in rails form
Reply: 0

Select multiple options in rails form

user2043 Published in March 23, 2018, 6:58 am

I have a long array of object coming from a csv file and I'd like to be able to choose a subset of the items to pass as params to my controller.


collection = 


But I cannot get the form working:

<%= form_tag import_weigh_ins_path, multipart: true do %>
    <%= collection_select(:scale_id, collection, :scale_id, :name, {:multiple => true}) %>
<% end %>

I know this isn't right but I'd like to pass the the :scale_id and the :name to my controller based on the boxes I check.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303304 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO