简体   繁体   中英

how to rename button new in index active admin rails

how to rename button new text in index active admin rails? example, i have button with value "New Book", how to change the text in button to "New Book Adventure"

i have code like this :

action_item :only => :index do
    config.clear_action_items!
    link_to "New Book Adventure" , "/admin/books/new" 
  end

but i get duplicate button in index page active admin?

You just need to get the config.clear_action_items! line out of your action_item block

Just like this:

config.clear_action_items!

action_item :only => :index do
    link_to "New Book Adventure" , "/admin/books/new" 
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM