Commit cefc5da

Stephen Peasley <s@stephenpeasley.com>
2015-08-09 20:39:39
Add i18n for profile update error
1 parent c74850c
Changed files (2)
app
config
locales
app/controllers/profiles_controller.rb
@@ -12,9 +12,10 @@ class ProfilesController < ApplicationController
   
   def update
     if @current_user.profile.update_attributes(profile_params)
-      flash[:notice] = t("profiles.edit.profile_updated")
+      flash[:notice] = t("profiles.edit.profile_update_success")
       redirect_to "/u/#{params[:id]}"
     else
+      flash[:notice] = t("profiles.edit.profile_updated_error")
       render 'edit'
     end
   end
config/locales/en.yml
@@ -50,7 +50,8 @@ en:
         high: High
         social_tolerance: Social Tolerance
       save: Save Profile
-      profile_updated: "Profile updated. This is how your public profile appears."
+      profile_update_error: "Your profile could not be updated."
+      profile_update_success: "Profile updated. This is how your public profile appears."
     show:
       exercise_header: Exercise
       maximum_achieved: Maximum Achieved