title: Active admin action item/member action
body: <p>So I have a batch action which works wonderfully.  But now I want the same action to be able to be used by clicked a button on the right (like view/edit/destroy).  But I can't seem to get it right.</p>
  
  <pre><code># app/admin/subscriptions.rb
  ActiveAdmin.register Subscription do
  ...
    batch_action :approve_selected do |subscriptions|
      subscriptions.each do |subscription|
        Subscription.find(subscription).approve
      end
      redirect_to :back
    end
  
    member_action :approve do
      Subscription.find(params[:id]).approve
      redirect_to :back
    end
  
    action_item :only =&gt; :show do
      link_to('Approve', approve_admin_subscription_path(subscription))
    end
  ...
  end
  </code></pre>
  
  <p>No button shows up next to View, Edit, or Delete with this code.  I figured it was because I'm using <code>:only =&gt; show</code> so I taking it off or using <code>only :index</code> but both give the following error (and I haven't been able to find much about it):</p>
  
  <pre><code>undefined local variable or method `subscription' for #&lt;ActiveAdmin::Views::ActionItems:0x007fb3a95b25c0&gt;
  </code></pre>
  
  <p>If I change the action item line to <code>action_item :only =&gt; index do |subscription|</code> then that gives the following error and <code>puts subscription</code> just gives some html (no idea why):</p>
  
  <pre><code>undefined method `each_byte' for nil:NilClass
  </code></pre>