Topic: Checkboxes in rails returning no value? How to get Checkboxes working

I am trying to get the values from my check boxes, but whenever I use params[:chosen], it seems to always return nil. What am I missing? is params the right way to do it?

This is the line I have in my view:


          <%=label_tag :chosen, "Choose Image" %>
          <%= check_box("product", "images", {checked: true}) %>
          <%= check_box_tag "chosen[#{i}]",1,true %></td

I tried check box also, but when i do params['images'], i still get nothing
                  <%= check_box("product", "images", {checked: true}) %>

this does produce the checkboxes but I can never seem to get the value from it. Do I need to put something in the controller?

Thank you

Last edited by thepal (2012-06-26 16:56:21)

Re: Checkboxes in rails returning no value? How to get Checkboxes working

Whats in your controller?