Forum: Ruby on Rails getting acquainted with REST

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Matt H. (Guest)
on 2009-05-15 01:08
(Received via mailing list)
I've been using RoR since 2.0 came out, and I've made several small
scale sites. Recently I've started trying to get into better habits, so
I'm now using rspec and cucumber with BDD to create my sites.

Another thing I'm trying to do is be faithful to the RESTful design.
I've got a small problem though that I'm not sure how to solve and still
be restful.

I've got a simple controller that will let users perform CRUD actions,
and I've got routes mapped out with

map.resources :events

This seems to work ok when testing with webrat and cucumber, but a
problem emerges when trying it from a browser:

events_path renders events/index as expected, however I'm planning to
use events_path with method POST to get to events/create. That will be a
form that will post to new_event (events/new).

Unfortunately, the browser (in this case firefox 3) doesn't respect the
method argument to the link and just sends it as a GET.

Am I doing something totally crazy or have I just missed something?

I can post code if necessary but it really is vanilla stuff.

Grateful for any ideas.

~Matt
Matt H. (Guest)
on 2009-05-15 01:12
(Received via mailing list)
Matt H. wrote:
>
> method argument to the link and just sends it as a GET.
>
> Am I doing something totally crazy or have I just missed something?

And as I thought, I was doing something incredibly stupid. Obviously I
should reverse the roles of create and new, I guess I shouldn't drink
while I'm learning new methods ;)

Sorry for the list pollution.
This topic is locked and can not be replied to.