I''ve read this a few times recently. I thought a model''s job was only to explain "This is how I behave myself" and the controller''s job was to explain "This is what I do". Is this basically right? So why do people want to stuff more and more stuff in the model? -- Posted via http://www.ruby-forum.com/.
No, I think the reasoning is that a model is "This is how my business logic works", and a controller is "This is what the outside world is allowed to requests of my models". On Sep 3, 3:09 pm, Aldric Giacomoni <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''ve read this a few times recently. > I thought a model''s job was only to explain "This is how I behave > myself" and the controller''s job was to explain "This is what I do". > Is this basically right? So why do people want to stuff more and more > stuff in the model? > -- > Posted viahttp://www.ruby-forum.com/.
You want the controller to responsible for passing model data from the database to the view and vice versa. You don''t want to clutter the controller with model specific logic...that''s why you want it in the model where it''s self-contained. Try this article: http://www.therailsway.com/2007/6/1/railsconf-recap-skinny-controllers On Sep 3, 2:09 pm, Aldric Giacomoni <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''ve read this a few times recently. > I thought a model''s job was only to explain "This is how I behave > myself" and the controller''s job was to explain "This is what I do". > Is this basically right? So why do people want to stuff more and more > stuff in the model? > -- > Posted viahttp://www.ruby-forum.com/.