Skip to content
Tiago Moraes edited this page Jan 25, 2014 · 8 revisions

If you'd like to override the page titles, follow this pattern (from #184)

ActiveAdmin.register Post do
  # Custom string
  index :title => 'Awesome Title' do
    # ...
  end
  # Call a method
  show :title => :my_title_method do
    # ...
  end
  # execute some code
  show :title => proc{ post.title } do
     # ...
  end
  # Custom actions
  collection_action :comments, :title => "My Awesome Comments" do
    # do stuff
  end
end

However, this doesn't yet handle the edit page because the form method ignores the :title. For edit pages, do this instead:

ActiveAdmin.register Post do
  controller do
    def edit
      @page_title = "Awesome Title"
    end
  end
end

Or, for all pages at once do this (from #2891):

ActiveAdmin.register Post do
  controller do
    before_filter { @page_title = "#{current_user} Posts" }
  end
end

Clone this wiki locally