Merge pull request #280 from warpc/257-new_design_for_profiles

[refs #257] fix user update registration page
This commit is contained in:
Vladimir Sharshov 2012-03-07 11:07:36 -08:00
commit 57c4c7032b
3 changed files with 6 additions and 4 deletions

View File

@ -10,11 +10,11 @@ class ApplicationController < ActionController::Base
after_filter lambda { EventLog.current_controller = nil }
helper_method :get_owner
rescue_from CanCan::AccessDenied do |exception|
redirect_to forbidden_url, :alert => t('flash.exception_message')#:alert => exception.message
end
protected
def set_locale
@ -45,7 +45,7 @@ class ApplicationController < ActionController::Base
end
def layout_by_resource
if devise_controller? && !(params[:controller] == 'devise/registrations' && params[:action] == 'edit')
if devise_controller? && !(params[:controller] == 'devise/registrations' && ['edit', 'update'].include?(params[:action]))
"sessions"
else
"application"

View File

@ -43,7 +43,8 @@ class UsersController < ApplicationController
if params[:user][:role] && current_user.admin?
@user.role = params[:user][:role]
params[:user].delete(:role)
end
end
@user ||= current_user
if @user.update_without_password(params[:user])
flash[:notice] = t('flash.user.saved')
redirect_to edit_user_path(@user)

View File

@ -3,6 +3,7 @@ Rosa::Application.routes.draw do
# XML RPC
match 'api/xmlrpc' => 'rpc#xe_index'
put '/users' => 'users#update'
devise_scope :user do
get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru'
end