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
<%= 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
This is my show
Opening Days: <%= @restaurant.opening %>
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