views:

43

answers:

2

am passing the hash in radio button option in my view like

<% @h[k].each do |val| %> <%= radio_button_tag(k, val)%>
<%= val %>
<% end %>

while selcting the radio buttons it passes the hash ( keys and values) to the database..

how can i access the the passed parameter in controller. inorder to update the count field based on the selection .

any help on this..

A: 

Your development.log logs the contents of params - you can find out where it ends up by looking there.

August Lilleaas
A: 

For each k in your hash, you can access the passed value by:

params[k]

Keep in mind that a radio button only passes it's value if it's selected, otherwise you get nothing.

ijcd