Topic: Why the need for more than one model?

Hey everyone, rails newbie here.
One issue I am having trouble wrapping my head around: Let's say you are building a simple news application, where users can add comments onto the end of news submitted by an administrator. If you have an "admin" controller, which has add, edit and delete functionality for comments, what need is there for a "user" controller? Can you not just create "user" displays, and reuse the admin controller's facilities? 

I am working through the "Agile web development with rails" book, and understand in the shopping cart scenario how a user and an administrator have different models and controllres, as users don't do the same action as admins.

Thanks -

Re: Why the need for more than one model?

Sure you can do that.  You can put everything in one controller no matter how large your app is.  But why not keep the functionality separate (and simpler) and use the Rails conventions as intended?  Rails has one controller for one model.  This is so that each controller offers list, edit, create, delete for one model.  You can, and will probably have to, include more functionality in each controller for application specific functions.

Re: Why the need for more than one model?

Ever since the focus on CRUD, it seems the way to go is to merge the user and admin sections of your site. An admin is just a user with special access. Why create two comments controllers which do roughly the same thing? With the CRUD approach, you just create one comments controller and give the admin user special access to certain areas of that controller (probably through a before_filter). Of course, no doubt, this doesn't work so well for every kind of site, but it is worth a try. Is this what you were asking?

See this blog post on Refactor to REST for an excellent example of this.

Railscasts - Free Ruby on Rails Screencasts