app/controllers/settings_controller.rb in social_stream-base-0.11.2 vs app/controllers/settings_controller.rb in social_stream-base-0.12.0
- old
+ new
@@ -20,24 +20,35 @@
current_subject.notify_by_email = false if notify_by_email.eql? "never"
current_subject.notify_by_email = true if notify_by_email.eql? "always"
end
end
+ #Updating language
+ if section.eql? "language"
+ #Preferred language setting
+ if params[:language].present?
+ lang = params[:language].to_s
+ current_user.language = lang[0..1]
+ end
+ end
+
#Here sections to add
#if section.eql? "section_name"
# blah blah blah
#end
- #Was everything ok?
- success = current_subject.save
+ # Was everything ok?
+ success = current_subject.save && current_user.save
end
#Flashing and redirecting
if success
flash[:success] = t('settings.success')
else
flash[:error] = t('settings.error')
end
- render :action => :index
+ # render :action => :index
+
+ redirect_to settings_path
end
end