Sha256: 4e7cf1c6f92d8bc67305abeb643a4b388a6636991f902b484af874c3e6f56130

Contents?: true

Size: 743 Bytes

Versions: 4

Compression:

Stored size: 743 Bytes

Contents

module Locomotive
  class PasswordsController < ::Devise::PasswordsController

    include Locomotive::Concerns::WithinSiteController

    within_site_only_if_existing true

    layout '/locomotive/layouts/not_logged_in'

    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

4 entries across 4 versions & 1 rubygems

Version Path
locomotivecms-3.0.0.rc4 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.0.0.rc3 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.0.0.rc2 app/controllers/locomotive/passwords_controller.rb
locomotivecms-3.0.0.rc1 app/controllers/locomotive/passwords_controller.rb