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

<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

Try the input name for array type which `` suffix: `restaurant[opening]`.

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...