Check_box

I have one for loop as below

<% for knowledge_base in @knowledge_bases %>

<%= check_box ("knowledge_base", "selection",{},checked_value = "1", unchecked_value = "0" ) %> <%= hidden_field "knowledge_base_selected", "id", "value" => knowledge_base.id %> <%= knowledge_base.keyword %> <% end %>

How can i get only the selected check box ids ie, hiddenfield
“knowledge_base_selected” “id” in the controller?Will I get it as array
in controller?

Sijo

Hi
Here I tried like following

<%= check_box :knowledge_base, :index => "#{knowledge_base.id}" %>

And in controller I get

index10index21index31index40 #If I selected 2,3 check boxes…What
I need is to extract 2,3 from this .How can I do this

Please help
Sijo

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs