On 18 November 2013 09:29, Srdjan Cengic wrote:
Question 1

Second requirement for route to be restful is that action corresponding to
route must "play by restful rules" in another word,
for example a GET should not leave side-effects on the server, but just
retrieve data.
So if i have /products(.:format) products#index and within index action i
saved something into DB, than above route is just looks like restful route
but in fact it isn't?
Whether it is restful or not is not relevant as you should not do
this. Imagine, for example, the havoc caused when google interrogates
all the GET routes in your application.
Question 2

I know that i can pass to restful route additional parameters, for example:
link_to "Show", products_path(id: 5, a: "aaaa", b: "bbbb") so now URL is:
So am i violating restful here, or this route is still restful?
It is still restful.
Question 3

To me seems that i don't need non-restful routes at all, when i can make a
bunch of restful routes with construct like following?(and other similar
Question 4

resources :products do
member do
get 'preview'
So what is the question you are asking? If the restful routes fit
your needs then use them, if they don't then use other routes.


You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuU8GcOgf29EsStLfx_D6jgp1UTtPLtOFBRNN%2BE-f9b2A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
grouprubyonrails-talk @
postedNov 18, '13 at 9:29a
activeNov 18, '13 at 9:53a

2 users in discussion

Colin Law: 1 post Srdjan Cengic: 1 post



site design / logo © 2021 Grokbase