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
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
def mobile_device?

View File

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

View File

@ -1,9 +1,22 @@
class ConfirmationsController < Devise::ConfirmationsController
layout "devise"
private
def after_confirmation_path_for(resource_name, resource)
basic_infos_path
def show
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
protected
def after_confirmation_path_for(resource_name, resource)
basic_infos_path(:user_id =>resource.id.to_s)
end
end