使用 as: '...' 选项注册页面时链接不起作用
Links are not working when registering page with as: '...' option
我有一个名为 Event 的页面,我想以不同的方式调用它,所以我使用 as: '...'
覆盖了它
ActiveAdmin.register Event, as: "MySite" do
...
end
但现在特定活动页面上的链接不起作用。
sidebar "Additional options", only: [:show] do
ul do
li link_to "Download CSV ", generate_csv_admin_event_path(resource, format: :csv)
end
end
我得到的错误是undefined method 'generate_csv_admin_event_path' for #<ActiveAdmin::Views::SidebarSection:0x00007fe54d0e7308>
我该如何解决?
Rails.application.routes.url_helpers.generate_csv_admin_event_path(resource, format: :csv)
我有一个名为 Event 的页面,我想以不同的方式调用它,所以我使用 as: '...'
ActiveAdmin.register Event, as: "MySite" do
...
end
但现在特定活动页面上的链接不起作用。
sidebar "Additional options", only: [:show] do
ul do
li link_to "Download CSV ", generate_csv_admin_event_path(resource, format: :csv)
end
end
我得到的错误是undefined method 'generate_csv_admin_event_path' for #<ActiveAdmin::Views::SidebarSection:0x00007fe54d0e7308>
我该如何解决?
Rails.application.routes.url_helpers.generate_csv_admin_event_path(resource, format: :csv)