- 支持配置的参数
可以在这个 /lib/devise.rb文件中查看
设置配置参数的方式:
Devise.setup do |config|
config.mailer_sender = 'example@example.com'
end
- 获取devise设置的配置参数
Devise.config_name
例如:获取email正则表达式
Devise.email_regexp
- 退出或者登录用户 sign_in sign_out
sign_in(resource_or_scope, *args)
Examples:
sign_in :user, @user # sign_in(scope, resource)
sign_in @user # sign_in(resource)
sign_in @user, event: :authentication # sign_in(resource, options)
sign_in @user, store: false # sign_in(resource, options)
====================================
sign_out(resource_or_scopel)
Examples:
sign_out :user # sign_out(scope)
sign_out @user # sign_out(resource)
lib/devise/controller/sign_in_out.rb