base controller

Conflicts:
	app/controllers/admin/commercials_controller.rb
	app/controllers/admin/questions_controller.rb
	app/controllers/admin/users_controller.rb
This commit is contained in:
Stella Rouzi 2014-08-13 14:37:05 +03:00
parent 336d0e9d04
commit 17ebad413e
29 changed files with 48 additions and 31 deletions

View file

@ -1,5 +1,5 @@
module Admin
class UsersController < ApplicationController
class UsersController < Admin::BaseController
load_and_authorize_resource
def new
@ -21,9 +21,9 @@ module Admin
def update
if @user.update_attributes(params[:user])
redirect_to admin_users_path, notice: "Updated #{@user.email}"
redirect_to admin_users_path, notice: "Updated #{@user.name} (#{@user.email})!"
else
redirect_to admin_users_path, alert: "Could not update #{@user.name}. #{@user.errors.full_messages.join '. '}."
redirect_to admin_users_path, alert: "Could not update #{@user.name} (#{@user.email}). #{@user.errors.full_messages.join('. ')}."
end
end