【发布时间】:2019-02-08 23:11:22
【问题描述】:
我正在尝试添加一个指向 ActiveAdmin 资源 Volunteer_Details 展示的链接。
在模型中编辑记录后,没有指向该资源索引的链接。
我知道我可以简单地单击顶部的资源页面链接,但为了方便起见,我想在每条记录的显示视图中添加一个链接。
我查看了here 并尝试按照该方法添加链接。
我的代码如下所示:
show do
attributes_table do
row :id
row 'Name' do |m|
m.participant.first_name + ' ' +m.participant.last_name
end
row :date
row :importance
row :story
row :questions
row :created_at
row :updated_at
row 'Go Back' do
link_to 'Volunteer Details', admin_volunteer_detail_path
end
end
active_admin_comments
end
如果我在这条记录上http://localhost:3000/admin/volunteer_details/4
我的代码链接回这个
我的显示视图创建的链接返回到我已经打开的页面,而不是`http://localhost:3000/admin/volunteer_details/
我希望链接返回到volunteer_details 索引页面。`
【问题讨论】:
标签: ruby-on-rails activeadmin link-to