On Thu, Jan 21, 2016, at 17:53, Matti Ezzat wrote: > Hi everyone, I am trying to get a multiple check_box_tag but when I am > checking all the boxes I only got the last check as a result, below are > my codes....what I want is what I check should be in the show the > checked only.. > > I also attached the screenshot of my app, you can see I checked multi > boxes but as result got only one... > > > This is my _form.html.erb > > <div class="field"> > <%= f.label :opening %><br> > <%= check_box_tag('restaurant[opening]', 'Mon') %> Mon > <%= check_box_tag('restaurant[opening]', 'Tus') %> Tus > <%= check_box_tag('restaurant[opening]', 'Wed') %> Wed > <%= check_box_tag('restaurant[opening]', 'Thu') %> Thu > <%= check_box_tag('restaurant[opening]', 'Fri') %> Fri > <%= check_box_tag('restaurant[opening]', 'Sat') %> Sat > <%= check_box_tag('restaurant[opening]', 'Sun') %> Sun > </div> > >
Try the input name for array type which `[]` suffix: `restaurant[opening][]`. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1453366797.1446690.498352754.6E2248B7%40webmail.messagingengine.com. For more options, visit https://groups.google.com/d/optout.