Sha256: cd8261925fd1560fb3a371980c97041650aa98fb979db0865938c4efd32603e3

Contents?: true

Size: 1.08 KB

Versions: 17

Compression:

Stored size: 1.08 KB

Contents

class Faalis::Dashboard::ProfileController < ::ApplicationController
  layout false
  def show
    @user = current_user
    respond_with(@user)
  end

  def update
    @user = ::Faalis::User.find(current_user.id)
    authorize @user
    respond_to do |f|
      if @user.update_without_password(resource_params)
        f.js { }
        f.html { }
      else
        @errors = @user.errors
        f.js {render :errors}
        f.html
      end
    end

  end


  # GET /sites/new
  def edit_password
    @user = ::Faalis::User.find(current_user.id)
    authorize @user
  end

  def update_password
    @user = ::Faalis::User.find(current_user.id)
    authorize @user
    respond_to do |f|
      if @user.update_with_password(resource_params)
        f.js { redirect_to new_user_session_path }
        f.html { redirect_to new_user_session_path }
      else
        @errors = @user.errors
        f.js {render :errors}
        f.html
      end
    end
  end

  def resource_params
    params.require(:user).permit(:password, :current_password, :password_confirmation, :first_name, :last_name, :email)
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
faalis-2.2.0.pre.rc1 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.2.1 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.2.0 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.1.1 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.1.0 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.0.8 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.0.7 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.0.5 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.0.4 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.0.3 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.0.1 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.0.0 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.0.0.rc6 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.0.0.rc5 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.0.0.rc4 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.0.0.rc3 app/controllers/faalis/dashboard/profile_controller.rb
faalis-2.0.0.rc2 app/controllers/faalis/dashboard/profile_controller.rb