如何在ActiveAdmin中添加回应用程序的链接? [英] How to add a link back to the application in ActiveAdmin?

查看:71
本文介绍了如何在ActiveAdmin中添加回应用程序的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在ActiveAdmin页面中添加一些指向应用程序某些页面的链接。我可以使用侧边栏来做到这一点,但是我必须为我的每个资源重复执行代码。无论如何,向标题添加自定义链接?还是定义所有资源都会显示的边栏?

I need to add a few links to certain pages of the application in the ActiveAdmin pages. I can do this using sidebars, but I'll have to repeat the code for each of my resources. Is there anyway of adding custom links to the header ? Or define a sidebar that will appear for all resources ?

推荐答案

我也不想忽略在初始化程序中设置config.site_title_link /active_admin.rb。

I also wouldn't want to overlook setting config.site_title_link in initializers/active_admin.rb.

我敢肯定,它带有一个代表您的应用程序中路由名称的符号,例如:

I'm pretty sure it takes a symbol representing the name of a route from your application, for example:

config.site_title_link = :root

将网站标题链接到应用程序的root_path。

would link the site title to your application's root_path.

这篇关于如何在ActiveAdmin中添加回应用程序的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆