2007-03-30 04:36:52 +00:00
|
|
|
class PreferencesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
def index
|
|
|
|
|
@page_title = "TRACKS::Preferences"
|
2007-07-30 05:29:18 +00:00
|
|
|
@prefs = prefs
|
2007-03-30 04:36:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def edit
|
|
|
|
|
@page_title = "TRACKS::Edit Preferences"
|
2007-07-30 05:29:18 +00:00
|
|
|
render :object => prefs
|
2007-03-30 04:36:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def update
|
2007-07-30 05:29:18 +00:00
|
|
|
user_updated = current_user.update_attributes(params['user'])
|
|
|
|
|
prefs_updated = current_user.preference.update_attributes(params['prefs'])
|
|
|
|
|
if user_updated && prefs_updated
|
2007-03-30 04:36:52 +00:00
|
|
|
redirect_to :action => 'index'
|
|
|
|
|
else
|
|
|
|
|
render :action => 'edit'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|