[Rails] Re: Controllers, what? why?
I'm writing an application to track calibrated assets. If I were to
have one controller it would have to be able to update(delete, create,
read) the items,vendors, issues...etc. It would be huge and certainly
unwieldy, not to mention very difficult to do in the Rails framework.
The Items controller deals with the items table. All the views to the
data happens through this controller which makes the code easy to read
and understand.
I think the issue here is about how to plan and build your
application. The controllers are the building blocks for the app and
so serve as the first layer of design that you are using to solve the
problem.
Hope this helps
On Jun 21, 7:04 am, "Paulo J. Matos" <pocma...@gmail.com> wrote:
> Hi,
>
> I am starting to learn rails and I went through the guide and a couple
> of tutorials. Even though I understand controllers or at least I can
> use them I can't see yet the whole picture.
>
> Why do you need several controllers for a single application? If a
> controller is just a class whose methods interface with models and
> views, why not have a single controller for the whole application?
> Can someone please comment on this maybe with an example on an obvious
> situation where having two controller makes more sense than having
> just one?
>
> Thanks,
>
> --
> PMatos
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home