title: Rails 4 ActionController::Metal with Serializers
body: <p>I'm trying to use ActionController::Metal in a Rails 4 project to make an API "base" controller as follows:</p>
  
  <pre><code># app/controllers/api/v1/base_controller.rb
  class Api::V1::BaseController &lt; ActionController::Metal
    include AbstractController::Rendering
    include ActionController::ImplicitRender
    include ActionController::Serialization
    include ActionController::MimeResponds
    include AbstractController::Callbacks
  end
  </code></pre>
  
  <p>I'm then inheriting from this in each of my API controllers, e.g.:</p>
  
  <pre><code># app/controllers/api/v1/plans_controller.rb
  class Api::V1::PlansController &lt; Api::V1::BaseController
    def index
      @plans = Plan.all
  
      if params[:ids]
        @plans = @plans.where(id: params[:ids])
      end
    end
  
    def show
      @plan = Plan.find(params[:id])
    end
  
    private
      def plan_params
        params.require(:plan).permit(:name)
      end
  end
  </code></pre>
  
  <p>I want to use <code>ActiveModel::Serializers</code> to generate the JSON responses for my API, I have created the following Serializer:</p>
  
  <pre><code># app/serializers/plan_serializer.rb
  class PlanSerializer &lt; ActiveModel::Serializer
    attributes :id, :name, :created_at, :updated_at
  end
  </code></pre>
  
  <p>I currently get an <code>undefined method 'each' for nil:NilClass</code> error when I try and load up my API endpoint (<code>/api/v1/plans.json</code>) - I think there is something missing from Metal which I need in order to use serializers, but I'm not sure what?!</p>