diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-09-25 17:15:00 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-09-25 17:15:00 -0300 |
commit | f82ecef9aef1798fa874c5104fef9d0dd072e757 (patch) | |
tree | 169e70a155f541d178a25b880cd265026ac76aaa /actionpack/lib | |
parent | b98c593bc8ee21403018dca9a5a2885c7293c3fb (diff) | |
parent | 2d08fd250638a39fbc8509b4e1c3f87a5f9e36c6 (diff) | |
download | rails-f82ecef9aef1798fa874c5104fef9d0dd072e757.tar.gz rails-f82ecef9aef1798fa874c5104fef9d0dd072e757.tar.bz2 rails-f82ecef9aef1798fa874c5104fef9d0dd072e757.zip |
Merge pull request #17058 from eval/issue-17057
Remove internal options from query string of paths
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/polymorphic_routes.rb | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index f15868d37e..1fa438f2eb 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb @@ -116,27 +116,13 @@ module ActionDispatch action, type, opts - end # Returns the path component of a URL for the given record. It uses # <tt>polymorphic_url</tt> with <tt>routing_type: :path</tt>. def polymorphic_path(record_or_hash_or_array, options = {}) - if Hash === record_or_hash_or_array - options = record_or_hash_or_array.merge(options) - record = options.delete :id - return polymorphic_path record, options - end - - opts = options.dup - action = opts.delete :action - type = :path - - HelperMethodBuilder.polymorphic_method self, - record_or_hash_or_array, - action, - type, - opts + opts = options.reverse_merge(:routing_type => :path) + polymorphic_url(record_or_hash_or_array, opts) end @@ -159,8 +145,7 @@ module ActionDispatch end def polymorphic_path_for_action(action, record_or_hash, options) - options = options.merge(:action => action, :routing_type => :path) - polymorphic_path(record_or_hash, options) + polymorphic_path(record_or_hash, options.merge(:action => action)) end class HelperMethodBuilder # :nodoc: |