From 85be030a434cfab4b7728e4883624d362ec7afbd Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 7 Dec 2012 13:00:44 +0100 Subject: first stub at displaying success messages --- users/app/controllers/users_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'users') diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb index 320ed96..24db13b 100644 --- a/users/app/controllers/users_controller.rb +++ b/users/app/controllers/users_controller.rb @@ -22,7 +22,9 @@ class UsersController < ApplicationController end def create - @user = User.create(params[:user]) + if @user = User.create(params[:user]) + flash[:notice] = t(:user_created_successfully) + end respond_with @user end @@ -30,7 +32,9 @@ class UsersController < ApplicationController end def update - @user.update_attributes(params[:user]) + if @user.update_attributes(params[:user]) + flash[:notice] = t(:user_updated_successfully) + end respond_with @user, :location => edit_user_path(@user) end -- cgit v1.2.3