diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 4b6d4fef97..5ecad6bc04 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -201,9 +201,11 @@ module ActionDispatch self.resources_path_names = self.class.default_resources_path_names.dup self.controller_namespaces = Set.new self.default_url_options = {} + self.request_class = request_class - self.valid_conditions = request_class.public_instance_methods.select{ |m| m != "id" }.map{ |m| m.to_sym } - self.valid_conditions += [:controller, :action] + self.valid_conditions = request_class.public_instance_methods.map { |m| m.to_sym } + self.valid_conditions.delete(:id) + self.valid_conditions.push(:controller, :action) @disable_clear_and_finalize = false clear!