Skip to content

Commit

Permalink
Made named route helpers compatible with Rails 2.3 optional formats
Browse files Browse the repository at this point in the history
  • Loading branch information
tomstuart authored and ianwhite committed Dec 11, 2008
1 parent 768fcf7 commit ff25e2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ardes/resources_controller/named_route_helper.rb
Expand Up @@ -124,7 +124,7 @@ def define_resource_named_route_helper_method_for_name_prefix(method)
name_prefix = method.to_s.sub(/^.*_for_/,'')
if resource_method =~ /enclosing_resource/
route, route_method = *route_and_method_from_enclosing_resource_method_and_name_prefix(resource_method, name_prefix)
required_args = route.significant_keys.reject{|k| [:controller, :action].include?(k)}.size
required_args = (route.significant_keys - [:controller, :action, :format]).size

self.class.send :module_eval, <<-end_eval, __FILE__, __LINE__
def #{method}(*args)
Expand All @@ -137,7 +137,7 @@ def #{method}(*args)

else
route, route_method = *route_and_method_from_resource_method_and_name_prefix(resource_method, name_prefix)
required_args = route.significant_keys.reject{|k| [:controller, :action].include?(k)}.size
required_args = (route.significant_keys - [:controller, :action, :format]).size

self.class.send :module_eval, <<-end_eval, __FILE__, __LINE__
def #{method}(*args)
Expand Down

0 comments on commit ff25e2d

Please sign in to comment.