Rails - Using checkboxes to select multiple objects and having a choice of actions to perform
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Id like to be able to create checkboxes for a list of objects. Then offer the user a number of actions to perform on the objects selected. I.e. delete, archive etc. I know of ryan's screencasts but it doesnt explain how to create links to multiple actions for the selected objects. It just showed him create a form_tag with a url to one action and a submit button. 回答1: I think you can do it in two ways. First: you can add as many buttons to one form as you want: <%= f.submit "Action 1" %> <%= f.submit "Action 2" %> <%= f.submit "Action 3" %>