I am using devise gem, I used :confirmable
to let the user confirm his account so the email will be sent to to him after he signed up and if he open the link it will be confirmed immediately.. What I want is to send the email to the user, after he signed up to show him his account then to give him option to confirm or not. Something like radio button
Here is my code in the user model
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable
before_create :confirm_email
def confirm_email
UserMailer.registration_confirmation(self).deliver
end
in the mailier
default :from => 'info@eccsbc.com'
def registration_confirmation(user)
@user = user
mail :to => 'nour@khatib.ca' ,:subject =>"New member please confirm"
end
in the user_mailier tempalate
<%= link_to 'Confirm my account', confirmation_url(@user, :confirmation_token => @user.confirmation_token) %>