如何向ActiveAdmin的索引页面添加按钮 [英] How to add button to ActiveAdmin's index page
本文介绍了如何向ActiveAdmin的索引页面添加按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我为ActiveAdmin rescource创建了一个收集操作,并希望从资源索引页面链接到它。
I created a collection action for ActiveAdmin rescource and want to link to it from the resource index page.
但是我如何自定义资源索引页面?
But how do I customize the resource index page?
手册提供了一些选项,但没有一个选项可以在页面上添加html /按钮(否则我看不到哪里)。
The manual gives some options, but none to add html / buttons on the page (or I cannot see where).
http://activeadmin.info/docs/3-index-pages.html
推荐答案
您可以使用 action_item
块在索引页上创建按钮:
You can create buttons on index page with action_item
block:
action_item only: :index do
link_to 'Button text', post_path(post)
end
https://github.com/activeadmin/activeadmin/blob/master/docs/8-custom-actions.md#action-items
这篇关于如何向ActiveAdmin的索引页面添加按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文