summaryrefslogtreecommitdiffstats
path: root/app/controllers/watchers_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-06 16:51:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-06 16:51:10 +0000
commit18270ee5879b387a23f659339555269319eb861f (patch)
tree56cc3a7099d12734d54ef538e0c3a1f2698c2163 /app/controllers/watchers_controller.rb
parenteabbab6e2b543c9ffe574c93d0df19e625802315 (diff)
downloadredmine-18270ee5879b387a23f659339555269319eb861f.tar.gz
redmine-18270ee5879b387a23f659339555269319eb861f.zip
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9363 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/watchers_controller.rb')
-rw-r--r--app/controllers/watchers_controller.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb
index 19af1e672..00f647023 100644
--- a/app/controllers/watchers_controller.rb
+++ b/app/controllers/watchers_controller.rb
@@ -52,7 +52,7 @@ class WatchersController < ApplicationController
end
end
respond_to do |format|
- format.html { redirect_to :back }
+ format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}
format.js do
render :update do |page|
page.replace_html 'ajax-modal', :partial => 'watchers/new', :locals => {:watched => @watched}
@@ -60,8 +60,6 @@ class WatchersController < ApplicationController
end
end
end
- rescue ::ActionController::RedirectBackError
- render :text => 'Watcher added.', :layout => true
end
def append
@@ -120,7 +118,7 @@ private
def set_watcher(user, watching)
@watched.set_watcher(user, watching)
respond_to do |format|
- format.html { redirect_to :back }
+ format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js do
render(:update) do |page|
c = watcher_css(@watched)
@@ -130,7 +128,5 @@ private
end
end
end
- rescue ::ActionController::RedirectBackError
- render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true
end
end