1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Reverts rendering behavior when format is unknown

If a request has unknown format (eg. /foo.bar), the renderer
fallbacks to default format.

This patch reverts Rails 3.2 behavior after c2267db commit.

Fixes issue #9654.
This commit is contained in:
Grzegorz Świrski 2013-04-01 15:06:36 +02:00 committed by Andrew White
parent 17a886b275
commit d50df2f116
2 changed files with 6 additions and 2 deletions

View file

@ -6,7 +6,7 @@ module ActionController
# Before processing, set the request formats in current controller formats.
def process_action(*) #:nodoc:
self.formats = request.formats.map { |x| x.ref }
self.formats = request.formats.select { |x| !x.nil? }.map(&:ref)
super
end

View file

@ -312,6 +312,10 @@ module Mime
true
end
def respond_to_missing?(method, include_private = false)
method.to_s.ends_with? '?'
end
private
def method_missing(method, *args)
false if method.to_s.ends_with? '?'