开发者

Customizing the edit page title in ActiveAdmin

开发者 https://www.devze.com 2023-04-07 06:15 出处:网络
I am trying to change the page title to be the name of the item you are actually editing when you are on the edit page. I read in the active admin docs that you should use @page_title. The problem is

I am trying to change the page title to be the name of the item you are actually editing when you are on the edit page. I read in the active admin docs that you should use @page_title. The problem is I开发者_Go百科 don't know where to put this for it to work for the edit page.


This will work:

controller do
  def new
    @page_title = 'new title'
    super
  end

  def edit
    @page_title = 'edit title'
    super
  end
end


I posted this in the active admin google group and they are looking to add this ability in to the next update. If they end up adding it i will post some info here on how it is accomplished.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号