Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveAdmin actions

Tags:

is there a way to specify in ActiveAdmin's index page of a model what actions are allowed, things like:

index do   actions :edit end  index do   actions only: :edit end 

do not work. What's the correct syntax?

Appreciated.

bundle show activeadmin /home/muichkine/.rvm/gems/ruby-2.1.2/bundler/gems/active_admin-9cfc45330e5a 
like image 335
muichkine Avatar asked Sep 08 '14 15:09

muichkine


1 Answers

Add whatever actions you want to be available by using actions (it is usually put under model definition):

ActiveAdmin.register YourModel do actions :index, :show, :create, :edit, :update 

If you want to specify the method for certain action, you can do

action_item only: :show  do   link_to 'Edit', action: :edit # so link will only be available on show action end 
like image 129
Andrey Deineko Avatar answered Oct 31 '22 02:10

Andrey Deineko