title: Cannot send link in Rails with Mailer
body: <p>I have an app that sends a invitation email containing a link to register. But the register link gives an error. The email will send if the register link is not there.</p>
  
  <pre><code>NoMethodError in Invitations#create
  undefined method `accept_referral_invitation_url' for #(#(Class:0xadd8c90):0xb5d868cc)
  </code></pre>
  
  <p>the error is happening on this line </p>
  
  <pre><code>= accept_referral_invitation_url(@invitation.invite_token)
  </code></pre>
  
  <p><strong>InvitationsController</strong></p>
  
  <pre><code>class InvitationsController &lt; ApplicationController
      def new
          @invitation = Invitation.new
      end
  
    def create
    @invitation = current_user.invitations.new(params[:invitation])
  
      if @invitation.valid?
        @invitation.save
        redirect_to root_url, :notice =&gt; "Invitation sent!"
        UserMailer.invitation(@invitation).deliver
      else
        render "new", :notice =&gt; "Somehting went wrong!"
      end
  end
  
  
    def accept_referral
        @invitation = Invitation.find_by_invite_token(params[:invite_token])
        @invitation.accepted_at = Time.zone.now
        @invitation.save!
        redirect_to root_url, :notice =&gt; "Success!"
    end
  
  end
  </code></pre>
  
  <p><strong>User Mailer</strong></p>
  
  <pre><code>class UserMailer &lt; ActionMailer::Base
    def invitation(invitation)
      @invitation = invitation
      mail(:to =&gt; invitation.email, :subject =&gt; "You're invited", :from =&gt; 'alain@lootfly.com')
    end
  end
  </code></pre>
  
  <p><strong>invitation.html.haml</strong> (message that gets sent)</p>
  
  <pre><code>You have been cordially invited to join beta.
  Click this link to sign up!
  = accept_referral_invitation_url(@invitation.invite_token)
  = accept_referral_invitation_url(invite_token: @invitation.invite_token)
  # I TRIED BOTH OF THOSE LINKS^^^^ TO NO AVAIL!!!!!!!
  </code></pre>
  
  <p><strong>invitations model</strong></p>
  
  <pre><code>  create_table "invitations", :force =&gt; true do |t|
      t.integer  "user_id"
      t.text     "email"
      t.text     "invite_token"
    end
  </code></pre>
  
  <p><strong>EDIT: Rake routes</strong></p>
  
  <pre><code>        invitations GET    /invitations(.:format)                invitations#index
                      POST   /invitations(.:format)                invitations#create
       new_invitation GET    /invitations/new(.:format)            invitations#new
      edit_invitation GET    /invitations/:id/edit(.:format)       invitations#edit
           invitation GET    /invitations/:id(.:format)            invitations#show
                      PUT    /invitations/:id(.:format)            invitations#update
                      DELETE /invitations/:id(.:format)            invitations#destroy
  </code></pre>