app/controllers/admin/preferences_controller.rb in radiant-0.8.2 vs app/controllers/admin/preferences_controller.rb in radiant-0.9.0.rc2
- old
+ new
@@ -15,14 +15,13 @@
end
def update
if valid_params?
if @user.update_attributes(params[:user])
- flash[:notice] = 'Your preferences have been updated.'
- redirect_to admin_pages_path
+ redirect_to :action => 'show'
else
- flash[:error] = 'There was an error updating your preferences.'
+ flash[:error] = t('preferences_controller.error_updating')
render :action => 'edit'
end
else
announce_bad_data
render :action => 'edit'
@@ -35,10 +34,10 @@
@user = current_user
end
def valid_params?
hash = (params[:user] || {}).symbolize_keys
- (hash.keys - User.protected_attributes).size == 0
+ (hash.keys - User.unprotected_attributes).size == 0
end
def announce_bad_data
flash[:error] = 'Bad form data.'
end