title: Rails - Email confirmation link giving 'Unknown Action' error
body: <p>I need a bit of help. I am trying to:</p>
  
  <ol>
  <li>Send am email with a link.</li>
  <li>Have the link set the user.email_activation_token = true</li>
  <li>Then redirect to the home page.</li>
  </ol>
  
  <p>Currently I have a link that goes to the email but it gives me this error. 
  (I'm using HAML btw.)</p>
  
  <p><strong>Edit:</strong> There is no view currently.</p>
  
  <h2>Unknown action</h2>
  
  <pre><code>The action 'show' could not be found for UsersController
  </code></pre>
  
  <p><strong>user_mailer/registration_confirmation</strong></p>
  
  <pre><code>Confirm your email address please!
  
  = accept_invitation_users_url({:token=&gt;@user.email_activation_token})
  </code></pre>
  
  <p><strong>users_controller.rb</strong></p>
  
  <pre><code>class UsersController &lt; ApplicationController
    def new
      @user = User.new
    end
    def create
      @user = User.new(params[:user])
      if @user.save
        UserMailer.registration_confirmation(@user).deliver
          redirect_to root_url, :notice =&gt; "Signed up!"
      else
          render "new"
      end
  
      def accept_invitation
          @user = User.find_by_email_activation_token!(params[:token])
          @user.email_activation_token = true
          redirect_to root_url, :notice =&gt; "Email has been verified."
      end
    end
  end
  </code></pre>
  
  <p><strong>email_activations_controller.rb</strong> </p>
  
  <pre><code>class EmailActivationsController &lt; ApplicationController
      def edit
          @user = User.find_by_email_activation_token!(params[:id])
          @user.email_activation_token = true
          save!
          redirect_to root_url, :notice =&gt; "Email has been verified."
      end
      def new
          @user = User.find_by_email_activation_token!(params[:id])
      end
  
      def edit
      end
  end
  </code></pre>
  
  <p><strong>user.rb (user model)</strong></p>
  
  <pre><code>    class User &lt; ActiveRecord::Base
        attr_accessible :email, :password, :password_confirmation
  
        attr_accessor :password
        before_save :encrypt_password
        before_save { |user| user.email = email.downcase }
        before_create { generate_token(:auth_token) }
        # before_create { generate_token(:email_activation_token) }
  
        VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
        VALID_PASSWORD_REGEX = /^(?=.*[a-zA-Z])(?=.*[0-9]).{6,}$/
        validates_confirmation_of :password
        validates :password, :on =&gt; :create, presence: true, format: { with: VALID_PASSWORD_REGEX }
        validates :email, presence: true, format: { with: VALID_EMAIL_REGEX }, uniqueness: { case_sensitive: false }
  
    def self.authenticate(email, password)
     user = find_by_email(email)
     if user &amp;&amp; user.password_hash == BCrypt::Engine.hash_secret(password, user.password_salt)
      user
     else  
      nil
    end
  end
  
    def send_password_reset
      generate_token(:password_reset_token)
      self.password_reset_sent_at = Time.zone.now
      save!
      UserMailer.password_reset(self).deliver
    end
  
    def encrypt_password
      if password.present?
          self.password_salt = BCrypt::Engine.generate_salt
          self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)
      end
    end
  
  def generate_token(column)
    begin
      self[column] = SecureRandom.urlsafe_base64
    end while User.exists?(column =&gt; self[column])
  end
  
  end
  </code></pre>
  
  <p><strong>routes.rb</strong></p>
  
  <pre><code>LootApp::Application.routes.draw do
    get "password_resets/new"
  
    get "sessions/new"
  
    resources :users
    resources :sessions
    resources :password_resets
    resources :email_activations
  
    resources :users do
      collection do 
        get :accept_invitation
      end 
    end
  
    # get "users/new"
    get "static_pages/home"
    get "static_pages/help"
  
  
    root to: 'static_pages#home'
    match "sign_up",  to: "users#new"
    match '/help',    to: 'static_pages#help'
    match '/log_in',  to: 'sessions#new'
    match '/log_out', to: 'sessions#destroy'
  end
  </code></pre>