More advance signup flow

This commit is contained in:
2015-02-24 17:56:06 +01:00
parent 16418dde30
commit cb723ea432
19 changed files with 123 additions and 48 deletions
+8 -1
View File
@@ -36,7 +36,7 @@ private
def set_locale
I18n.locale = (params[:locale].presence || I18n.default_locale).to_sym
end
def _render_with_renderer_json(resource, options)
serializer = build_json_serializer(resource, options)
@@ -55,6 +55,13 @@ private
"theme1"
end
def after_sign_in_path_for(resource)
case resource
when Employee then supplier_root_path
else root_path
end
end
def check_active_list_state
if current_user.try(:active_list_id)
unless active_list.active?
+3 -1
View File
@@ -14,7 +14,9 @@ class NewSuppliersController < ApplicationController
@new_supplier.current_employee = current_employee
if @new_supplier.save
redirect_to supplier_root_path
sign_in @new_supplier.employee unless current_employee
session[:supplier_id] = @new_supplier.supplier.try(:id)
redirect_to supplier_root_path(anchor: '/pages/introduction')
else
render 'new'
end
@@ -1,4 +1,8 @@
class RegistrationsController < Devise::RegistrationsController
protected
#def after_sign_up_path(resource)
#end
private
@@ -0,0 +1,7 @@
class Suppliers::SessionsController < Devise::SessionsController
def destroy
session[:supplier_id] = nil
super
end
end