Commit c74850c

Stephen Peasley <s@stephenpeasley.com>
2015-08-09 20:38:23
i18n success message
1 parent fe2d8ff
Changed files (2)
app
config
locales
app/controllers/profiles_controller.rb
@@ -11,9 +11,8 @@ class ProfilesController < ApplicationController
   end
   
   def update
-#    @user = User.find_by(username: params[:id]) if @current_user.username == params[:id]
     if @current_user.profile.update_attributes(profile_params)
-      flash[:notice] = "Updated profile. This is how your public profile appears."
+      flash[:notice] = t("profiles.edit.profile_updated")
       redirect_to "/u/#{params[:id]}"
     else
       render 'edit'
@@ -23,7 +22,7 @@ class ProfilesController < ApplicationController
   private
 
     def profile_params
-      params.require(:profile).permit([:gender, :social_tolerance])
+      params.require(:profile).permit(:gender, :social_tolerance)
     end
       
 end
config/locales/en.yml
@@ -50,6 +50,7 @@ en:
         high: High
         social_tolerance: Social Tolerance
       save: Save Profile
+      profile_updated: "Profile updated. This is how your public profile appears."
     show:
       exercise_header: Exercise
       maximum_achieved: Maximum Achieved