diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-12-03 09:39:56 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-12-03 09:39:56 +0000 |
commit | 483133285e96ad5701d0ce11d76a106d8c5e49cd (patch) | |
tree | d88ae5e736c0a1291c9fed9164b9baf9e9f26bf4 /app/controllers | |
parent | a52417eca9311aabaeaab847873aea52cb78ce52 (diff) | |
download | redmine-483133285e96ad5701d0ce11d76a106d8c5e49cd.tar.gz redmine-483133285e96ad5701d0ce11d76a106d8c5e49cd.zip |
Add responders to UsersController.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4451 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/users_controller.rb | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index bf38f87fd..abb32c4ff 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -46,7 +46,9 @@ class UsersController < ApplicationController :limit => @user_pages.items_per_page, :offset => @user_pages.current.offset - render :layout => !request.xhr? + respond_to do |format| + format.html { render :layout => !request.xhr? } + end end def show @@ -64,8 +66,10 @@ class UsersController < ApplicationController return end end - render :layout => 'base' - + + respond_to do |format| + format.html { render :layout => 'base' } + end rescue ActiveRecord::RecordNotFound render_404 end @@ -98,15 +102,23 @@ class UsersController < ApplicationController @user.notified_project_ids = (params[:notification_option] == 'selected' ? params[:notified_project_ids] : []) Mailer.deliver_account_information(@user, params[:password]) if params[:send_information] - flash[:notice] = l(:notice_successful_create) - redirect_to(params[:continue] ? {:controller => 'users', :action => 'new'} : - {:controller => 'users', :action => 'edit', :id => @user}) - return + + respond_to do |format| + format.html { + flash[:notice] = l(:notice_successful_create) + redirect_to(params[:continue] ? + {:controller => 'users', :action => 'new'} : + {:controller => 'users', :action => 'edit', :id => @user} + ) + } + end else @auth_sources = AuthSource.find(:all) @notification_option = @user.mail_notification - render :action => 'new' + respond_to do |format| + format.html { render :action => 'new' } + end end end @@ -148,13 +160,20 @@ class UsersController < ApplicationController elsif @user.active? && params[:send_information] && !params[:password].blank? && @user.auth_source_id.nil? Mailer.deliver_account_information(@user, params[:password]) end - flash[:notice] = l(:notice_successful_update) - redirect_to :back + + respond_to do |format| + format.html { + flash[:notice] = l(:notice_successful_update) + redirect_to :back + } + end else @auth_sources = AuthSource.find(:all) @membership ||= Member.new - render :action => :edit + respond_to do |format| + format.html { render :action => :edit } + end end rescue ::ActionController::RedirectBackError redirect_to :controller => 'users', :action => 'edit', :id => @user |