Ivor P. wrote:
If I understand you correctly, then in your controller you would like an
array of the checked items which you will access from params.
I have recently done this for assigning roles to users:
My controller action looked like this:
user_roles = params[:role]
user_roles.each do |job|
UserRole.create(:user_id => params[:user_id], :role_id =>
redirect_to ‘somewhere else’
The value is only returned if the checkbox is checked so you get an
all the checked id’s.
i got the method right but am wondering what is happening when i do
My view has this
<%form_tag :action=>‘selected’ do%>
<%for result in @results%>
And the in the controller i have this method
however i get a blank page. but when i inspect the logs i see that the
parameters were posted.
how do i get the checked ids rendered or displayed to the user?