Class: Admin::PreferencesController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/admin/preferences_controller.rb

Instance Method Summary collapse

Constructor Details

#initializePreferencesController

Returns a new instance of PreferencesController.



4
5
6
7
# File 'app/controllers/admin/preferences_controller.rb', line 4

def initialize
  @controller_name = 'user'
  @template_name = 'preferences'
end

Instance Method Details

#editObject



14
15
16
# File 'app/controllers/admin/preferences_controller.rb', line 14

def edit
  render :layout => 'radiant'
end

#showObject



9
10
11
12
# File 'app/controllers/admin/preferences_controller.rb', line 9

def show    
  set_standard_body_style
  render :edit, :layout => 'radiant'
end

#updateObject



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/controllers/admin/preferences_controller.rb', line 18

def update
  if valid_params?
    if @user.update_attributes(params[:user])
      redirect_to :action => 'show'
    else
      flash[:error] = t('preferences_controller.error_updating')
      render :edit, :layout => 'radiant'
    end
  else
    announce_bad_data
    render :edit, :layout => 'radiant'
  end
end