/ activeadmin

Customise ActiveAdmin TitleBar

How do we customise Titlebar in ActiveAdmin show view?
For example, in the attached screenshot, I have breadcrumb as Admin / Orders / Order #11834 in my show view. Instead of that I want to customise it and display it just as "Admin / Orders / Order# 43872378123 & Transaction# MwlDdTc3RW" or just "Admin / Orders / Transaction# MwlDdTc3RW".

Its fairly easy,

In app/admin/order.rb

show title: proc{ |order|
  order.transaction_number.present? ? 
    "Transaction# #{order.transaction_number}" : "Order# #{order.order_number}" } do

In general,

show title: proc {|post| post.title} do
  # ........

Reference / Link: [Customising Page Title (https://github.com/activeadmin/activeadmin/wiki/Set-page-title)][1]
[1]: https://github.com/activeadmin/activeadmin/wiki/Set-page-title

Rohan Daxini

Rohan Daxini

Founder at Kiprosh | Ruby, Elixir, JS & C lover | Life Long Learner | Books | Technology | Mindfulness | Gratitude

Read More