Sha256: fb2afc8657d8be48efefad706164eace2b6ff60a5757ce587c7deb61ff44b162

Contents?: true

Size: 848 Bytes

Versions: 11

Compression:

Stored size: 848 Bytes

Contents

module Locomotive
  class PasswordsController < ::Devise::PasswordsController

    include Locomotive::Concerns::SslController
    include Locomotive::Concerns::RedirectToMainHostController
    include Locomotive::Concerns::WithinSiteController

    within_site_only_if_existing true

    layout '/locomotive/layouts/account'

    helper Locomotive::BaseHelper

    before_filter :set_locale

    def update
      super do |resource|
        if params[:locomotive_account].try(:[], 'password').blank?
          resource.errors.add_on_blank(:password)
        end
      end
    end

    private

    def after_sending_reset_password_instructions_path_for(resource_name)
      new_locomotive_account_session_path
    end

    def set_locale
      if current_site?
        I18n.locale = current_site.accounts.first.locale
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
locomotivecms-3.1.2 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.2.0.rc1 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.1.1 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.1.0 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.1.0.rc3 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.1.0.rc2 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.1.0.rc1 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.0.1 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.0.0 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.0.0.rc7 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.0.0.rc6 app/controllers/locomotive/passwords_controller.rb