(I am fairly new to Rails too) Rails is a MVC framework, methods in
the Model usually describe the behavior of the bussiness and should
not know about how to "display" what they are doing. Methods in the
Controllers allow you to coordinate the Model (behavior) and View so
user actions across the View are traslated into Model changes, and so
on.
This decoupling pattern allows you to later select a different view
and keep the same bussines logic unchnaged, or viceversa.
--
Aníbal Rojas
http://www.lacaraoscura.com/
anibalrojas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
On 10/23/05, Mark Paxton <mcp-qIFWa415ktg2EctHIo1CcQ@public.gmane.org>
wrote:> Hi,
>
> I''m fairly new to RoR and I''m still getting to grips with
how things are
> supposed to work. I''ve been looking through the Agile Web
Development
> book but there''s one thing that''s not quite clear to me
that I''d
> appreciate help with.
>
> In the depot shopping cart example (around chapter 8) there''s a
private
> method "find_cart" that''s gets put into the store
controller then there
> the "add_product" and other methods that do into the cart model.
>
> Could anybody clarify the difference between methods in controllers and
> models? Or at least point me in the right direction!
>
> Cheers,
> Mark
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>