Ruby on Rails Tuesday, June 10, 2014

mike2r wrote in post #1149390:
> IMO, it can be done either way. If you use routes, it would be a little
> cleaner when you are using the same resource more than once to make a
> concern:
>
> concern :commentable do
> resources :comments
> end
>
> resources :posts, concerns: [:commentable]
> resources :users, concerns: [:commentable]

When doing this, does this mean both of these resources would access the
same controller? How can I have them access different controllers, and
what would a proper naming convention be for each controller in your
example?

--
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@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/f112b7bea93554970f58bfa9dc30c887%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment