Rails-8-API-Image-Processing / app /controllers /users /passwords_controller.rb
denise-oneill-inbox-ru's picture
D8 staging from 92665ef4298ecff6735b080ff7901f2c19f719a7
5010ad7 verified
Raw History Blame Contribute Delete
582 Bytes
class Users::PasswordsController < Devise::PasswordsController
layout "devise"
before_action :set_background_image
skip_before_action :authenticate_user!, only: [ :new, :create, :edit, :update ]
before_action :set_locale
private
def set_locale
I18n.locale = params[:locale] || session[:locale] || I18n.default_locale
end
def set_background_image
case action_name
when "new"
@background_image = "forgot-password.png"
when "edit"
@background_image = "forgot-password.png"
else
@background_image = "login.png"
end
end
end