I am new to rails and I am trying to add confirmation email when registering. I am currently getting this error.
( Bonus points for any detailed and easy to understand answer.)
Routing error
There are no route matches {: action => "edit",: controller => "email_activations",: id => false}
configurations /routes.rb
LootApp::Application.routes.draw do get "password_resets/new" get "sessions/new" resources :users resources :sessions resources :password_resets resources :email_activations root to: 'static_pages#home'
application / senders / user_mailer.rb
class UserMailer < ActionMailer::Base def registration_confirmation(user) @user = user mail(:to => user.email, :subject => "registered", :from => " alain@private.com ") end end
application / controllers / email_activations_controller.rb
class EmailActivationsController < ApplicationController def edit @user = User.find_by_email_activation_token!(params[:id]) @user.email_activation_token = true redirect_to root_url, :notice => "Email has been verified." end end
app / views / user_mailer / registration_confirmation.html.haml
Verify your email address!
= edit_email_activation_url (@ user.email_activation_token)
source share