title: ActionMailer wrong number of arguments error
body: <p>I have a rails app that allows you to request an invite to sign up. Upon request I save your email and send you an email saying thanks 'you have requested to join in'. For some reason the line <code>UserMailer.request(@request).deliver</code> gives me this error ArgumentError in RequestsController#create -- wrong number of arguments (0 for 1)</p>
  
  <p>Any ideas?</p>
  
  <p><strong>requests controller</strong></p>
  
  <pre><code>class RequestsController &lt; ApplicationController
    def new
      @request = Request.new
    end
  
    def create
      @request = Request.new(params[:request])
      if @request.valid?
        if User.find_by_email(@request.email) || Invitation.find_by_email(@request.email)
          redirect_to log_in_path, notice: "Email already in use"
        elsif @request.save
          @request.save
          redirect_to root_url, :notice =&gt; "Request sent."
          UserMailer.request(@request).deliver
        end
      else
          render "new"
      end
    end
  end
  </code></pre>
  
  <p><strong>request.html.haml</strong></p>
  
  <pre><code>You have requested to join in
  </code></pre>
  
  <p><strong>mailers/user_mailer.rb</strong></p>
  
  <pre><code>class UserMailer &lt; ActionMailer::Base
    def request(request)
      @request = request
      mail(:to =&gt; request.email, :subject =&gt; "Requested an invite", :from =&gt; 'alain@lootfly.com')
    end
  end
  </code></pre>