Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 226
3lviend Avatar asked May 08 '14 08:05

3lviend


1 Answers

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
like image 129
rorofromfrance Avatar answered Nov 01 '22 08:11

rorofromfrance