Confirmations Workflow working

This commit is contained in:
saurabhbhatia 2013-11-29 18:46:07 +08:00
parent f1c2e29bf1
commit 6e9c21781c
3 changed files with 18 additions and 13 deletions

View File

@ -452,14 +452,6 @@ class ApplicationController < ActionController::Base
objects objects
end end
def after_sign_in_path_for(resource)
if current_user.email.blank?
admin_users_new_interface_edit_user_data_path(current_user)
else
root_path
end
end
private private
def mobile_device? def mobile_device?

View File

@ -1,10 +1,10 @@
class BasicInfosController < ApplicationController class BasicInfosController < ApplicationController
layout "devise" layout "devise"
def index def index
if current_user.nil? if params[:user_id].nil?
redirect_to "/users/sign_up" redirect_to "/users/sign_up"
end end
@user = current_user @user = User.find(params[:user_id])
end end
def form_page def form_page

View File

@ -1,9 +1,22 @@
class ConfirmationsController < Devise::ConfirmationsController class ConfirmationsController < Devise::ConfirmationsController
layout "devise" layout "devise"
private
def after_confirmation_path_for(resource_name, resource) def show
basic_infos_path self.resource = resource_class.confirm_by_token(params[:confirmation_token])
if resource.errors.empty?
set_flash_message(:notice, :confirmed) if is_navigational_format?
respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource) }
else
respond_with_navigational(resource.errors, :status => :unprocessable_entity){ render_with_scope :new }
end end
end
protected
def after_confirmation_path_for(resource_name, resource)
basic_infos_path(:user_id =>resource.id.to_s)
end
end end