diff options
author | Rick Olson <technoweenie@gmail.com> | 2007-12-28 17:03:58 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2007-12-28 17:03:58 +0000 |
commit | c54b915825b034b431b4b0cdb28f8ca00fca808d (patch) | |
tree | bbc4f216661139f0134e12005c5bfaadb02f894b /activeresource/lib/active_resource/custom_methods.rb | |
parent | 90d75e5109cb3e2fd172711b479ab29bda249544 (diff) | |
download | rails-c54b915825b034b431b4b0cdb28f8ca00fca808d.tar.gz rails-c54b915825b034b431b4b0cdb28f8ca00fca808d.tar.bz2 rails-c54b915825b034b431b4b0cdb28f8ca00fca808d.zip |
Support agnostic formats when calling custom methods. Closes #10635 [joerichsen]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8502 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activeresource/lib/active_resource/custom_methods.rb')
-rw-r--r-- | activeresource/lib/active_resource/custom_methods.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activeresource/lib/active_resource/custom_methods.rb b/activeresource/lib/active_resource/custom_methods.rb index 4f5697fcf1..70e7ac9ab6 100644 --- a/activeresource/lib/active_resource/custom_methods.rb +++ b/activeresource/lib/active_resource/custom_methods.rb @@ -80,7 +80,7 @@ module ActiveResource module ClassMethods def custom_method_collection_url(method_name, options = {}) prefix_options, query_options = split_options(options) - "#{prefix(prefix_options)}#{collection_name}/#{method_name}.xml#{query_string(query_options)}" + "#{prefix(prefix_options)}#{collection_name}/#{method_name}.#{format.extension}#{query_string(query_options)}" end end @@ -108,11 +108,11 @@ module ActiveResource private def custom_method_element_url(method_name, options = {}) - "#{self.class.prefix(prefix_options)}#{self.class.collection_name}/#{id}/#{method_name}.xml#{self.class.send!(:query_string, options)}" + "#{self.class.prefix(prefix_options)}#{self.class.collection_name}/#{id}/#{method_name}.#{self.class.format.extension}#{self.class.send!(:query_string, options)}" end def custom_method_new_element_url(method_name, options = {}) - "#{self.class.prefix(prefix_options)}#{self.class.collection_name}/new/#{method_name}.xml#{self.class.send!(:query_string, options)}" + "#{self.class.prefix(prefix_options)}#{self.class.collection_name}/new/#{method_name}.#{self.class.format.extension}#{self.class.send!(:query_string, options)}" end end end |