【发布时间】:2015-06-28 20:15:19
【问题描述】:
我是 Rails 新手,我们将不胜感激任何建议和帮助。
我目前正在使用可确认的设计
当用户第一次注册时:
- 重定向到 localhost:3000 的应用程序根目录
- Flash 通知显示“带有确认链接的消息已发送到您的电子邮件地址。请打开链接以激活您的帐户。”
到目前为止一切顺利。
我试图在用户注册时将他们重定向到不同的页面 但不确定如何 - 任何建议将不胜感激
application_controller.rb
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :configure_permitted_parameters, if: :devise_controller?
protected
def after_sign_in_path_for(resources)
if userr_signed_in?
dashboard_path
elsif usera_signed_in?
admin_path
else
dashboardj_path
end
end
def after_sign_out_path_for(resources)
new_feedback_path
end
def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:email) }
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:category_businesstype_id, :firstname, :lastname, :companyname, :email, :password, :category_role_id, :staff, :number, :hear, :city, :category_qualification_id, :language, :category_careerlevel_id, :desiredjob, :category_distance_id, :category_cvpreference_id, :category_joboption_id, :preferedlocation, :category_notice_id, :category_country_id, :category_positiontype_id ) }
end
end
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-4 devise