I have a view where user can observe part of the objects from database:
class SyncController < ApplicationController
def one
@ids = get_ids(...) # ids of objects, which user can see on the view
end
end
On the same view there is a link which must delete objects in the the database by this @ids. So i need to pass this list of ids ([10000, 100001, 100009 ...]) to next method. To do it I have created link on my view:
<%= link_to "mark_as_read", { :controller => 'Sync', :action => "two", :ids => @ids }, :class => "mark_as_read_link", :remote => true %>
In the controller I am iterating over this list and delete objects:
def two
params[:ids].each { |id|
.....
}
end
I am just wondering if there is a better way to pass this ids-list, because it can be very long and i'm not sure that the link doesn't have any limitations.