/ Authentication / Resend Confirmation Email Form (Devise)

Confirmation controller

class ConfirmationsController < Devise::ConfirmationsController

  # POST /resource/confirmation
  def create
    # self.resource = resource_class.send_confirmation_instructions(resource_params)
    self.resource = resource_class.send_confirmation_instructions({email: current_user.email})
    if successfully_sent?(resource)
      respond_with({}, :location => after_resending_confirmation_instructions_path_for(resource_name))
    else
      respond_with(resource)
    end
  end

protected

  # The path used after resending confirmation instructions.
  def after_resending_confirmation_instructions_path_for(resource_name)
    root_path
  end
end

 

Routes

devise_for :users, controllers: { confirmations: "confirmations" }

 

View

<%= link_to "resend confirmation", user_confirmation_path, data: { method: :post } %>

 

 

 

SEE CONVERSATION HERE: http://stackoverflow.com/questions/9627564/devise-confirmable-how-to-resend-a-confirmation-email-on-click

 

No video for this post.

No issues for this post.

by ryzalyusoff