Sha256: cb4e083e87f4ad1aa806b0cb10712689c9b59ec9502851e70bf01404efc08d0c

Contents?: true

Size: 693 Bytes

Versions: 2

Compression:

Stored size: 693 Bytes

Contents

class User::ProfilesController < User::UserApplicationController

  before_action :set_profile, only: [:show, :edit, :update]
  add_breadcrumb I18n.t('dock.profile'), :user_profile_path

  def show
    add_breadcrumb @profile.full_name, user_profile_path
    respond_with([:user, @profile])
  end

  def edit
    add_breadcrumb t('tooltips.edit'), edit_user_profile_path
  end

  def update
    @profile.update(profile_params)
    respond_with([:user, @profile], location: user_profile_path)
  end

  private

  def set_profile
    @profile = current_user
  end

  def profile_params
    params.require(:user)
      .permit(
        :name,
        :surname,
        :time_zone
    )
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cybele-1.9.1 templates/app/controllers/user/profiles_controller.rb
cybele-1.9.0 templates/app/controllers/user/profiles_controller.rb