Class: Admin::PreferencesController
- Defined in:
- app/controllers/admin/preferences_controller.rb
Instance Method Summary collapse
- #edit ⇒ Object
-
#initialize ⇒ PreferencesController
constructor
A new instance of PreferencesController.
- #show ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize ⇒ PreferencesController
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
#edit ⇒ Object
13 14 15 |
# File 'app/controllers/admin/preferences_controller.rb', line 13 def edit render end |
#show ⇒ Object
9 10 11 |
# File 'app/controllers/admin/preferences_controller.rb', line 9 def show redirect_to :action => 'edit' end |
#update ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/admin/preferences_controller.rb', line 17 def update if valid_params? if @user.update_attributes(params[:user]) redirect_to :action => 'show' else flash[:error] = 'There was an error updating your preferences.' render :action => 'edit' end else announce_bad_data render :action => 'edit' end end |