def action(set, name, options = {}, &block)
      warn "Warning: method `#{name}` already defined" 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
def action(set, name, options = {}, &block)
      warn "Warning: method `#{name}` already defined" 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
Member Actions give you the functionality of defining both the
 action and the route directly from your ActiveAdmin registration
 block.

 For example:

   ActiveAdmin.register Post do
     member_action :comments do
       @post = Post.find(params[:id])
       @comments = @post.comments
     end
   end

 Will create a new controller action comments and will hook it up to
 the named route (comments_admin_post_path) /admin/posts/:id/comments

 You can treat everything within the block as a standard Rails controller
 action.