class ActiveAdmin::ResourceDSL
def action(set, name, options = {}, &block)
action.
You can treat everything within the block as a standard Rails controller
the named route (comments_admin_post_path) /admin/posts/:id/comments
Will create a new controller action comments and will hook it up to
end
end
@comments = @post.comments
@post = Post.find(params[:id])
member_action :comments do
ActiveAdmin.register Post do
For example:
block.
action and the route directly from your ActiveAdmin registration
Member Actions give you the functionality of defining both the
def action(set, name, options = {}, &block) warn "Warning: method `#{name}` already defined in #{controller.name}" if controller.method_defined?(name) set << ControllerAction.new(name, options) title = options.delete(:title) controller do before_action(only: [name]) { @page_title = title } if title define_method(name, &block || Proc.new {}) end end