In my Rails app, what would be the way to access a Devise config variable directly from a view?
I want to show config.allow_unconfirmed_access_for from Devise’s :confirmable module. This variable is set in devise.rb initializer:
Devise.setup do
config.allow_unconfirmed_access_for = 3.days
end
Thanks!
The configurations on
devise.rbfile are replicated on your Devise model, so if your Devise resource isUser, you should be able to access it throughUser.allow_unconfirmed_access_for.So, create an instance variable on your controller and assign this value to it, and then you’ll be able to show it on your view.