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:in
`recognize
The problem looks like an extra forward slash after companies, if so how can
it?
Regards,
Leon Leslie
--
Never be afraid to try something new. Remember, amateurs built the ark;
professionals built the Titanic!
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
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 Leslie <leonleslie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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:in > `recognize > > The problem looks like an extra forward slash after companies, if so how > can it? > > Regards, > Leon Leslie > > -- > 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! --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Leslie
<leonleslie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> 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 Leslie <
leonleslie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> > 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:in
> > `recognize
> >
> > The problem looks like an extra forward slash after companies, if so
how
> > can it?
> >
> > Regards,
> > Leon Leslie
> >
> > --
> > 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!
>
--
Never be afraid to try something new. Remember, amateurs built the ark;
professionals built the Titanic!
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---