如何添加到ActiveAdmin视图的链接 [英] how do add a link to an ActiveAdmin view

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

问题描述

我有:

ActiveAdmin.register User do
  show :title => :name do     
    attributes_table do
      row :username
      row :email
      row :last_request_at
      row :foo
    end
  end
end

,而我想让foo只是创建< a href = / foo> foo< / a> 在视图中。

and I want foo just make a <a href="/foo">foo</a> in the view.

所以我定义:

def foo
  <a href="/foo">foo</a>
end

。它会显示,但标签已被转义,因此不可点击。有简单的方法吗?

in the user.rb model. And it displays but the tag is escaped so it's not clickable. Is there a simple way to do this?

推荐答案

您可以尝试:

row :foo do
  link_to('foo','#')
end

并用您的路线替换'#'

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

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