Permalink
Browse files

Merge pull request #2527 from cesario/fix_2511

Methods like status and location are interfering with redirect_to [Closes #2511]
  • Loading branch information...
2 parents bf2b9d2 + 75dd33a commit 99f87c9ad325e610df6298a1b8dec571cd920230 @josevalim josevalim committed Aug 14, 2011
@@ -58,8 +58,8 @@ def send_data(data, options = {})
def redirect_to(*args)
ActiveSupport::Notifications.instrument("redirect_to.action_controller") do |payload|
result = super
- payload[:status] = self.status
- payload[:location] = self.location
+ payload[:status] = response.status
+ payload[:location] = response.location
result
end
end
@@ -97,4 +97,4 @@ def log_process_action(payload) #:nodoc:
end
end
end
-end
+end
@@ -4,6 +4,11 @@ class WorkshopsController < ActionController::Base
end
class RedirectController < ActionController::Base
+ # empty method not used anywhere to ensure methods like
+ # `status` and `location` aren't called on `redirect_to` calls
+ def status; render :text => 'called status'; end
+ def location; render :text => 'called location'; end
+
def simple_redirect
redirect_to :action => "hello_world"
end

0 comments on commit 99f87c9

Please sign in to comment.