Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

extended functionality of url_helpers, especially for parent_url acti…

…ons. Now you can call parent_url(:action => :edit)
  • Loading branch information...
commit 70a28a85caa3fb667b9b12b06aad70ee1ca3c69f 1 parent edf6721
Alexander authored
Showing with 12 additions and 2 deletions.
  1. +12 −2 lib/inherited_resources/url_helpers.rb
14 lib/inherited_resources/url_helpers.rb
View
@@ -214,12 +214,22 @@ def generate_url_and_path_helpers(prefix, name, resource_segments, resource_ivar
protected
def #{prefix}#{name}_path(*given_args)
given_options = given_args.extract_options!
- #{prefix}#{segments}_path(#{ivars})
+ if given_options[:action] then
+ prefix = "\#{given_options[:action]}_"
+ send prefix + "#{segments}_path", #{ivars}
+ else
+ #{prefix}#{segments}_path(#{ivars})
+ end
end
def #{prefix}#{name}_url(*given_args)
given_options = given_args.extract_options!
- #{prefix}#{segments}_url(#{ivars})
+ if given_options[:action] then
+ prefix = "\#{given_options[:action]}_"
+ send prefix + "#{segments}_url", #{ivars}
+ else
+ #{prefix}#{segments}_url(#{ivars})
+ end
end
URL_HELPERS
end
Please sign in to comment.
Something went wrong with that request. Please try again.