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>
This is my show
<p> <strong>Opening Days:</strong> <%= @restaurant.opening %> <p>
I am not doing anything in the controller those were my old codes in controller but it didnt work..
def opening(restaurant) @opening = params[:opening] || end
Attachments: http://www.ruby-forum.com/attachment/11234/Screen_Shot_2016-01-21_at_09.48.48.png http://www.ruby-forum.com/attachment/11235/Screen_Shot_2016-01-21_at_09.51.08.png