title: Rails 4 - Simple include multiple JSON inside another JSON
body: <p>I have the following controller:</p>
  
  <pre><code>  # orders_controller.rb
  
    def update_quantity
      @product = Product.by_id(params[:product_id])
      @product_details = ProductDetail.availables.by_id(params[:product_id])
  
      respond_to do |format|
        format.json { render :json =&gt; @product.to_json( { :include =&gt; [ :current_price, :product_details ] } ) }
      end
    end
  </code></pre>
  
  <p>I just want to return a JSON with product data, including them current price and products_details, but just the available details (Inventory).</p>
  
  <p>The products and current_price are working good but If I use :product_details, rails includes ALL the details and I want the contained  inside @product_details variable.</p>
  
  <p>Thanks</p>