Sha256: 5cd5797256230e3dff90c49bfbc9f6e8ea9f17f7604e0a4398ec48c5eca6583c

Contents?: true

Size: 687 Bytes

Versions: 73

Compression:

Stored size: 687 Bytes

Contents

class Admin::PreferencesController < ApplicationController
  before_action :initialize_variables

  def show
    set_standard_body_style
    render :edit
  end

  def edit
    render
  end

  def update
    if @user.update(preferences_params)
      redirect_to admin_configuration_path
    else
      flash[:error] = t('preferences_controller.error_updating')
      render :edit
    end
  end

  private

  def initialize_variables
    @user            = current_user
    @controller_name = 'user'
    @template_name   = 'preferences'
  end

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

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
trusty-cms-6.0.5 app/controllers/admin/preferences_controller.rb
trusty-cms-6.0.4 app/controllers/admin/preferences_controller.rb
trusty-cms-6.0.3 app/controllers/admin/preferences_controller.rb
trusty-cms-6.0.2 app/controllers/admin/preferences_controller.rb
trusty-cms-6.0.1 app/controllers/admin/preferences_controller.rb
trusty-cms-5.6.1 app/controllers/admin/preferences_controller.rb
trusty-cms-6.0.0 app/controllers/admin/preferences_controller.rb
trusty-cms-5.6.0 app/controllers/admin/preferences_controller.rb
trusty-cms-5.5.9 app/controllers/admin/preferences_controller.rb
trusty-cms-5.5.8 app/controllers/admin/preferences_controller.rb
trusty-cms-5.5.7 app/controllers/admin/preferences_controller.rb
trusty-cms-5.5.6 app/controllers/admin/preferences_controller.rb
trusty-cms-5.5.5.1 app/controllers/admin/preferences_controller.rb
trusty-cms-5.5.1 app/controllers/admin/preferences_controller.rb
trusty-cms-5.5 app/controllers/admin/preferences_controller.rb
trusty-cms-5.4.4 app/controllers/admin/preferences_controller.rb
trusty-cms-5.4.3 app/controllers/admin/preferences_controller.rb
trusty-cms-5.4.2 app/controllers/admin/preferences_controller.rb
trusty-cms-5.4.1 app/controllers/admin/preferences_controller.rb
trusty-cms-5.4.0 app/controllers/admin/preferences_controller.rb