Im just diving into the world of rails and ruby. Ive followed along a tutorial and i got the base of my app setup, but now i want to do some calculations wich don't really fit into the MVC scheme (or at least not like the rest of the stuff so far) and i don't know where to put and or handle them.
1. Ive got a form where a user can enter their weight, but for each new record I need some data from the record prior to this new one.
How would i go about that, where is the right moment to retrieve this data and should it be done inside the controller, model or elsewhere?
2. With every seventh entry (each week) i want to use those seven records and do some calculations (where should those calculations take place?) Also, with that seventh submission, i want to save those calculations in another model (1 post = 2 records in different models)
Would be awesome if you guys could help me and sorry if this is obvious stuff I am still really new to this.