I am creating this calming application using RoR, and it's hard for me to draw a line between the things that should go along the model and the things that should go on the controller.
As an example, I have 7 methods on my controller (those that make it calm, i.e. index (), show (), create (), update () ...) and often find that additional ones need to be added methods, and do it by creating them as members.
What I would like to do here is collecting experience from you guys about what is happening there (where should I stick to all interactions with the databases on the model and just call these methods from the controller?)
In addition, adding things that are not related to the database to my controller, that is, I want to make an HTTP call to screen some data from the website.
HTTP calls can become large and messy. Should all this go to my controller, or will it be a separate class or module, and only be included in my controller so that it can be called?
If so, what would be the best way to do this?
I'm a little confused by all of this, so it would be great if someone introduced.
Thanks in advance
ruby ruby-on-rails model-view-controller
Marcos placona
source share