Monday, January 16, 2012

Holy shit I've got a RESTful connection to a non-rails app with Rails... only a billion goddamn overrides of ActiveResource every GOD DAMN time I use the thing:

This finder produces:

EtilizeProduct.find(:catalog, :params => {:appId => 'xxxxxx', :method => 'getVersion'})
Reports: 200 OK 157 (199.0ms) (Version 3.0) XML

I had to override element_path in ActiveResource::Base to do this:

  class << self
    def element_path(id, prefix_options = {}, query_options = nil)
      prefix_options, query_options = split_options(prefix_options) if query_options.nil?

#Idea from:
This is here in case I need to do this again.


No comments: