On Tue, Mar 24, 2009 at 1:03 PM, ressister <ressis...@gmail.com> wrote:
>
> I'm in the process of refactoring an existing Rails app and am
> wondering - is it common practice to have a controller for each model
> that has CRUD actions?  For instance, in my app I have a side bar
> where users can add diary entries to a side-bar, highlighting them in
> bulletin-board fashion within their diary.  This bulletin board will
> only live inside the diary.  Should it have its own controller then?

It's up to you how to separate things, there's no limit on how many or
how few controllers you can or have to have.

> What's the general rule.  I've been reading The Rails Way, and it
> seems that it should, which would also allow me to create a nested
> resource for this as well which would allow for some out-of-the-box
> routing if I were ever to surface this component somewhere else.
>
> I look forward to your thoughts, and thanks!

I split things up as much as I can at the start, makes growing the app
easier later.  You might consider putting things that require
authentication in separate controllers than one that don't for
example.


-- 
Greg Donald
http://destiney.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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to