My application will utilize a REST-API that does not follow the Ruby-
type REST paths (/customers.xml). I had a look at the methods in
ActiveResources that sets the paths and I believe they could offer
more customization. The current methods allow additional prefix and a
querystring but forces use of a extension (can be custom though). So
this means I can use /customers.json, /customers.api?hello=world or
whatever but not /customers/ (which is what I have to access now).
def collection_path(prefix_options = {}, query_options = nil)
prefix_options, query_options = split_options(prefix_options)
if query_options.nil?
"#{prefix(prefix_options)}#{collection_name}.#
{format.extension}#{query_string(query_options)}"
end
http://github.com/rails/rails/blob/27766ccf3b98216a4b1035281c6e0e31a790abe4/activeresource/lib/active_resource/base.rb
Any thoughts on how to improve the implementation in ActiveResource or
a smart way of overriding the method?
Cheers,
Espen Antonsen
http://inspired.no
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.