ActiveResource RoutingError

I have the following

  • Edge Rails
  • Initial ActiveResource Checkin

class Company < ActiveResource::Base
self.site = “http://localhost:3000/
end

this works
c = Company.find(1)

when i try this

c.save

I get
ActionController::RoutingError (no route found to match
“/companies/.xml”
with {
:method=>:put}):
/vendor/rails/actionpack/lib/action_controller/routing.rb:1250:in
recognize _path' /vendor/rails/actionpack/lib/action_controller/routing.rb:1240:inrecognize

The problem looks like an extra forward slash after companies, if so how
can
it?

Regards,
Leon L.


Never be afraid to try something new. Remember, amateurs built the ark;
professionals built the Titanic!

c.save works if it is an update

if it is a new record I get the above routingerror.

regards,
Leon.

On 11/11/06, Leon L. [email protected] wrote:

:method=>:put}):
Leon L.


Never be afraid to try something new. Remember, amateurs built the ark;
professionals built the Titanic!


Never be afraid to try something new. Remember, amateurs built the ark;
professionals built the Titanic!

changed /rails/activeresource/lib/active_resource/base.rb line 83 to
read

  def update
    id? ? connection.put(self.class.element_path(id), to_xml) :

connection.post(self.class.collection_path, to_xml)
end

instead of

  def update
    connection.put(self.class.element_path(id), to_xml)
  end

and it works!!!

On 11/11/06, Leon L. [email protected] wrote:

this works
/vendor/rails/actionpack/lib/action_controller/routing.rb:1250:in


Never be afraid to try something new. Remember, amateurs built the ark;
professionals built the Titanic!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs