Chris P.
2014-Jun-09 18:59 UTC
Is it an ok practice to define a resource in your routes file multiple times? 3+ times?
Noobie here. Let's say you have a Post, Comment, and User models. So
Post has_many comments, and User has_many comments.
If it good practice to do the following...
resources :posts do
resources :comments
end
resources :users do
resources :comments
end
etc?
I have a model in my schema that I believe I will likely have 3
different route resources for.
Or is better to just have the one, such as our first snippet of code
above, and then have a param that modifies what is returned, in this
example, passing in the user_id to just see comments for that user?
--
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 unsubscribe from this group and stop receiving emails from it, send an email
to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/409b245643f51f2e64338538f310cc0e%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.