diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-07-21 20:49:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-07-21 20:49:14 +0000 |
commit | 8b107b6058257fb44d9ddca7e55d58033cc2b023 (patch) | |
tree | 73f3604107387b53196152cee2ca16a6145f1b18 /app/controllers | |
parent | 596a196f2e7e8355f102ad6b6e59e03d77230eff (diff) | |
download | redmine-8b107b6058257fb44d9ddca7e55d58033cc2b023.tar.gz redmine-8b107b6058257fb44d9ddca7e55d58033cc2b023.zip |
Don't use render :text => "".
git-svn-id: http://svn.redmine.org/redmine/trunk@15731 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/mail_handler_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/sys_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/watchers_controller.rb | 9 |
4 files changed, 9 insertions, 7 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4f5f03336..ba79b949f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -654,8 +654,7 @@ class ApplicationController < ActionController::Base # Renders a head API response def render_api_head(status) - # #head would return a response body with one space - render :text => '', :status => status, :layout => nil + head :status => status end # Renders API response on validation failure diff --git a/app/controllers/mail_handler_controller.rb b/app/controllers/mail_handler_controller.rb index 1b7cddfac..82ca7cce2 100644 --- a/app/controllers/mail_handler_controller.rb +++ b/app/controllers/mail_handler_controller.rb @@ -38,7 +38,7 @@ class MailHandlerController < ActionController::Base def check_credential User.current = nil unless Setting.mail_handler_api_enabled? && params[:key].to_s == Setting.mail_handler_api_key - render :text => 'Access denied. Incoming emails WS is disabled or key is invalid.', :status => 403 + render :plain => 'Access denied. Incoming emails WS is disabled or key is invalid.', :status => 403 end end end diff --git a/app/controllers/sys_controller.rb b/app/controllers/sys_controller.rb index 87b489d3a..6ef72a15f 100644 --- a/app/controllers/sys_controller.rb +++ b/app/controllers/sys_controller.rb @@ -74,7 +74,7 @@ class SysController < ActionController::Base def check_enabled User.current = nil unless Setting.sys_api_enabled? && params[:key].to_s == Setting.sys_api_key - render :text => 'Access denied. Repository management WS is disabled or key is invalid.', :status => 403 + render :plain => 'Access denied. Repository management WS is disabled or key is invalid.', :status => 403 return false end end diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index eda84a82e..d0658b574 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -47,7 +47,7 @@ class WatchersController < ApplicationController end end respond_to do |format| - format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}} + format.html { redirect_to_referer_or {render :html => 'Watcher added.', :status => 200, :layout => true}} format.js { @users = users_for_new_watcher } format.api { render_api_ok } end @@ -69,7 +69,7 @@ class WatchersController < ApplicationController watchable.set_watcher(user, false) end respond_to do |format| - format.html { redirect_to :back } + format.html { redirect_to_referer_or {render :html => 'Watcher removed.', :status => 200, :layout => true} } format.js format.api { render_api_ok } end @@ -108,7 +108,10 @@ class WatchersController < ApplicationController watchable.set_watcher(user, watching) end respond_to do |format| - format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} + format.html { + text = watching ? 'Watcher added.' : 'Watcher removed.' + redirect_to_referer_or {render :html => text, :status => 200, :layout => true} + } format.js { render :partial => 'set_watcher', :locals => {:user => user, :watched => watchables} } end end |