Check_box_tag showing only last checked

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

<%= f.label :opening %>
<%= 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] || []

On Thu, Jan 21, 2016, at 17:53, Matti E. wrote:

Try the input name for array type which [] suffix:

I did and now I am getting no results its empty even if I check one box

On Thu, Jan 21, 2016, at 18:15, Matti E. wrote:

I did and now I am getting no results its empty even if I check one box

if it uses strong parameter, you need to permit array. Otherwise, check
what the console says about the input or what browser sends to server.

Ohhh thank you very much It was really helpful, I just needed to add
:opening => [] to permit then it shows all the checked boxes…