Commit e68e20e4 by Thanh Hung Pham

update

parent 7dc1c878
class ConfirmationsController < Devise::ConfirmationsController
def update_confirm
@user = User.find(params[:id])
@user = User.find(params[:user][:id])
if @user.save
set_flash_message!(:notice, :confirmed)
redirect_to edit_user_registration_path(resource_name, resource)
......@@ -10,21 +10,26 @@ class ConfirmationsController < Devise::ConfirmationsController
end
# GET /resource/confirmation?confirmation_token=abcdef
def show
self.resource = resource_class.confirm_by_token(params[:confirmation_token])
yield resource if block_given?
def show
self.resource = resource_class.confirm_by_token(params[:confirmation_token])
yield resource if block_given?
if resource.errors.empty?
set_flash_message!(:notice, :confirmed)
respond_with_navigational(resource){ render 'devise/confirmations/information', resource: resource }
else
respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new }
if resource.errors.empty?
set_flash_message!(:notice, :confirmed)
respond_with_navigational(resource){ render 'devise/confirmations/information', resource: resource }
else
respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new }
end
end
end
protected
def after_confirmation_path_for(resource_name, resource)
render 'devise/confirmations/information', resource: resource
end
private
def user_params
params.requires(:user).permit(:email, :fullname, :password, :cd_name)
end
end
......@@ -2,7 +2,7 @@
<div class="well">
<h2>Register</h2>
<%= form_for(resource, url: confirmations_update_confirm_path, html: { method: :post }) do |f| %>
<%= form_for(resource, url: confirmations_update_confirm_path(resource), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<div class="form-group">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment