Sha256: f6684bc20c935041def3865d40ba2b3ed0dc6e0757e6eb360b249f3d5cd7689c

Contents?: true

Size: 803 Bytes

Versions: 9

Compression:

Stored size: 803 Bytes

Contents

class Admin::SettingsController < Admin::ApplicationController

  before_action :require_user
  skip_before_action :require_admin_user

  before_action do |c|
    if current_user && current_user.has_admin_rights?
      add_breadcrumb "Settings", :admin_settings_path
    end
  end

  def edit
    
  end

  def update
    if @current_user.update_attributes(user_params)
      if user_params.include?(:password)
        SpudUserSession.create(@current_user)
      end
      flash[:notice] = "User settings saved successfully."
      respond_with @current_user, :location => admin_settings_path
    else
      render 'edit'  
    end
  end

private

  def user_params
    params.require(:spud_user).permit(:login, :first_name, :last_name, :email, :password, :password_confirmation, :time_zone)
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tb_core-1.3.5 app/controllers/admin/settings_controller.rb
tb_core-1.3.4 app/controllers/admin/settings_controller.rb
tb_core-1.3.3 app/controllers/admin/settings_controller.rb
tb_core-1.3.2 app/controllers/admin/settings_controller.rb
tb_core-1.3.1 app/controllers/admin/settings_controller.rb
tb_core-1.3.0 app/controllers/admin/settings_controller.rb
tb_core-1.3.0.beta2 app/controllers/admin/settings_controller.rb
tb_core-1.3.0.beta1 app/controllers/admin/settings_controller.rb
tb_core-1.2.8 app/controllers/admin/settings_controller.rb