timothy.....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
wrote:> I have purchased the peepcode tutorial on RESTful and I have to say it
> is brilliant, one thing it does not answer is this question though.
>
> I have been experimenting with rails on nothing serious and managed to
> setup an application for which the routes did which for example did,
>
> www.myapplication.com/company_name
>
> therefore www.myapplication.com/google would pull up googles profile
> from the database
>
> I have looked at RESTful and that suggests
> www.myapplication.com/companies/company_name
> would be the RESTful way to do it, does that mean using RESTful style
> routes I cannot achieve the configuration "www.myapplication.com/
> company_name"?
>
> Or am I just a rails n00b whos missed the point of RESTful?
>
> Thanks for any help anyone can give me!
REST means that all the state for specifying the resource is present in
the URL, instead of in the session or other server state. If
www.myapplication.com/company_name works for you, that''s fine.
It''s a
perfectly valid RESTful URL. However, the map.resources helper will
probably have some kind of problem not having a controller name in the
url, but you can always roll the routes by hand (just specify the
:method in the :requirements). Just keep in mind this approach could
also lead to name collisions. Like, if you have a :cookies resource and
a "cookies" company, those names could collide. Other than that, it
shouldn''t be a problem.
--
Josh Susser
http://blog.hasmanythrough.com
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---