I am making a system private message.
I want catch all object with checkbox checked and if the user click on trash, send to trash action and if click on spam, send to spam action inside message controller. You can see the next image:

This is my checkbox html :
<input class="check" id="506c82001d41c82198000056" name="506c82001d41c82198000056" type="checkbox" value="506c82001d41c82198000056">
Is generated with:
<%= check_box_tag m.id, m.id, false, :class => "check" %>
Delete and spam button are links with format:
<%= link_to "Delete", delete_message_path %>
<%= link_to "Spam", spam_message_path %>
how I can send the results that have been marked with checkbox checkeck to each action?
Thank you very much!
If you want a pure html implementation, you can route the form to a single controller action and either handle delete and spam logic from there or redirect to those actions.
In your form
you can have two submit tags that lead to some url, say
/messages_cleanupwhich has a route likematch /messages_cleanup, :to => 'messages#cleanup'.Then in your messages controller, you can check the submit type in the
params[:commit]field.