如何传递数组的值?选中的复选框。
在视图中:
= check_box_tag 'user_message_ids[]', user_message.id, false
= link_to "<button>Bulk Delete</button>".html_safe, profile_message_path(user_message), :id => 'user_message_ids', :confirm => "Are you sure?", :method => :delete
我可以将提交按钮放在这个区域的任何地方吗?
像这个:
= form_tag checked_messages_path do
= check_box_tag 'user_message_ids[]', user_message.id, false
--------objects---------------------------------------------
--------objects---------------------------------------------
--------objects---------------------------------------------
--------objects---------------------------------------------
= submit_tag "Delete Checked"