Sha256: 0f0efd80c6de9583d21d6c180f7c4d3ed9b31b1154b7d15f2d3e4dd4f497f5c0

Contents?: true

Size: 734 Bytes

Versions: 13

Compression:

Stored size: 734 Bytes

Contents

class MyAdmin::PasswordController < MyAdmin::MyAdminController
  
  before_filter :add_breadcrumbs
  
  def edit
    @user = MyAdmin::User.find(my_admin_user.id)
  end
  
  def update
    @user = MyAdmin::User.find(my_admin_user.id)
    if (@user.update_attributes(password_params))
      redirect_to send("#{admin_prefix}_root_path"), :flash => { :notice => I18n.t("my_admin.messages.user.password_changed") }
    else
      render :edit
    end
  end
  
private

  def add_breadcrumbs
    breadcrumbs.add('my_admin_home', send("#{admin_prefix}_root_path"))
    breadcrumbs.add('change_password')
  end
  
  def password_params
    params.require(:my_admin_user).permit(:old_password, :password, :password_confirmation)
  end
  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
my_admin-0.1.13 app/controllers/my_admin/password_controller.rb
my_admin-0.1.12 app/controllers/my_admin/password_controller.rb
my_admin-0.1.11 app/controllers/my_admin/password_controller.rb
my_admin-0.1.10 app/controllers/my_admin/password_controller.rb
my_admin-0.1.9 app/controllers/my_admin/password_controller.rb
my_admin-0.1.8 app/controllers/my_admin/password_controller.rb
my_admin-0.1.7 app/controllers/my_admin/password_controller.rb
my_admin-0.1.6 app/controllers/my_admin/password_controller.rb
my_admin-0.1.5 app/controllers/my_admin/password_controller.rb
my_admin-0.1.4 app/controllers/my_admin/password_controller.rb
my_admin-0.1.3 app/controllers/my_admin/password_controller.rb
my_admin-0.1.2 app/controllers/my_admin/password_controller.rb
my_admin-0.1.1 app/controllers/my_admin/password_controller.rb