Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I hide "Save and Add Another" button from edit form in rails_admin?

I applied a rails_admin gem in my Rails app. I want to remove some unnecessary buttons in a specific model edit form, and add my own custom button instead. Please see the screenshot for what I'd like to remove.

Snapshot of layout

like image 327
ashvin Avatar asked Aug 12 '15 14:08

ashvin


1 Answers

@montells Copy https://github.com/sferik/rails_admin/blob/master/app/views/rails_admin/main/_submit_buttons.html.haml this page in your repo at "views/rails_admin/main/_submit_buttons.html.haml"

Now in this file, you can put the condition in which page you want to remove button e.g.

- if params[:model_name]
 - if params[:model_name] != "model_name_in_which_you_want_hide_button"
   "Paste above url view"
like image 105
ashvin Avatar answered Nov 12 '22 02:11

ashvin