Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在管理部分的项目中使用了活动的管理 gem。
我写了一个自定义方法使用
collection_action :method_name 做
//代码在这里
结尾
现在我想将此方法名称添加到菜单项中。我怎样才能做到这一点?
请让我知道该怎么做?
collection_action 会创建对应的路由和动作。如果您需要在菜单项中提供此操作,则必须具有以下几行
action_item only: :index do link_to 'Name the button', action: 'method_name' end