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
Any thoughts on how to improve the implementation in ActiveResource or a smart way of overriding the method?
Cheers, Espen Antonsen