Sha256: 37afc1f6476bced4dd38c1a33fdcb89f2207af004c32e89640fe4ee75ecdbfa1

Contents?: true

Size: 809 Bytes

Versions: 12

Compression:

Stored size: 809 Bytes

Contents

class IshManager::UserProfilesController < IshManager::ApplicationController

  def index
    @user_profiles = IshModels::UserProfile.all
    authorize! :index, IshModels::UserProfile
  end

  def show
    @user_profile = IshModels::UserProfile.find params[:id]
    authorize! :show, @user_profile
  end

  def edit
    @profile = IshModels::UserProfile.find params[:id]
    authorize! :edit, @profile
  end

  def update
    @profile = IshModels::UserProfile.find params[:id]
    authorize! :update, @profile
    flag = @profile.update_attributes params[:ish_models_user_profile].permit!
    if flag
      flash[:notice] = "Updated profile #{@profile.email}"
    else
      flash[:alert] = "Cannot update profile: #{pp_errors @profile.errors.messages}"
    end
    redirect_to :action => :index
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ish_manager-0.1.8.50 app/controllers/ish_manager/user_profiles_controller.rb
ish_manager-0.1.8.49 app/controllers/ish_manager/user_profiles_controller.rb
ish_manager-0.1.8.47 app/controllers/ish_manager/user_profiles_controller.rb
ish_manager-0.1.8.46 app/controllers/ish_manager/user_profiles_controller.rb
ish_manager-0.1.8.45 app/controllers/ish_manager/user_profiles_controller.rb
ish_manager-0.1.8.44 app/controllers/ish_manager/user_profiles_controller.rb
ish_manager-0.1.8.43 app/controllers/ish_manager/user_profiles_controller.rb
ish_manager-0.1.8.41 app/controllers/ish_manager/user_profiles_controller.rb
ish_manager-0.1.8.40 app/controllers/ish_manager/user_profiles_controller.rb
ish_manager-0.1.8.39 app/controllers/ish_manager/user_profiles_controller.rb
ish_manager-0.1.8.38 app/controllers/ish_manager/user_profiles_controller.rb
ish_manager-0.1.8.37 app/controllers/ish_manager/user_profiles_controller.rb