Rails passing a list of objects to another controller with link_to_remote

87 views Asked by At

Is it possible to pass a list of objects to another controller in Ruby on Rails?

I have experimented with the following example:

class Student
 ...
end

student_list = [std1, std2, ... stdn]

When I use

<%= link_to_remote("example", :url => {:controller => 'class/assignment',
                                                      :action => 'homework',
                                                      :student => student_list})%>

It did not work the way I expected. params[:student] is equal to "student" (string literal).

Is there anything I did wrong, or an alternate way of doing it?

0

There are 0 answers