title: ActionMailer fails
body: <p>I get a no method error when trying to send out email with ActionMailer</p>
  
  <pre><code>NoMethodError in OrdersController#deliver
  undefined method `client' for #&lt;OrdersController:0x007fdc22aa4938&gt;
  </code></pre>
  
  <p>My Mailer</p>
  
  <pre><code> class OrdersMailer &lt; ActionMailer::Base
   def email_copy_of_order_to_client(order)
      @order = order
      @client = @order.client
      mail(:to =&gt; @client.email, :subject =&gt; "Your order")
    end
  </code></pre>
  
  <p>Of course through the console I get what I want</p>
  
  <pre><code>  Order.last.client
      Order Load (0.2ms)  SELECT "orders".* FROM "orders" ORDER BY "orders"."id" DESC LIMIT 1
    =&gt; #&lt;Client id: 3, name: "Test Client", address1: "", address2: "", city: ""...`
  </code></pre>
  
  <p>EDITED</p>
  
  <pre><code>class OrdersController &lt; InheritedResources::Base
  def deliver
  @email = OrdersMailer.email_copy_of_order_to_client(self).deliver
  
  respond_to do |format|
    if @email.valid?
      format.html { redirect_to order, notice: 'Order was successfully sent.' }
    else
      format.html { render action: "show", alert: 'An error occured. Please try again.' }
    end
  end
  end
  </code></pre>
  
  <p>Order#show view</p>
  
  <pre><code>&lt;%= pill_button_link_to "Send Order by Email", deliver_order_path(@order) %&gt;
  </code></pre>
  
  <p>Any idea?</p>