Rails noob - How to work on data stored in models

Posted by Raghav Kanwal on Programmers See other posts from Programmers or by Raghav Kanwal
Published on 2013-11-08T20:18:28Z Indexed on 2013/11/08 22:13 UTC
Read the original article Hit count: 439

Filed under:
|
|
|

I'm a beginner to Ruby and Rails, and I have made a couple applications like a Microposts clone and a Todo-List for starters, but I'm starting work on another project.

I've got 2 models - user and tracker, you log in via the username which is authenticated and you can log down data which is stored in the tracker table.

The tracker has a column named "Calories" and I would like Rails to sum all of the values entered if they are on the same date, and output the result which is subtracted from, say 3000 in a new statement after the display of the model. I know what I'm talking about is just ruby code, im just not sure how to incorporate it. :(

Could someone please guide me through this? And also link me to some guides/tutorials which teach working on data from models?

Thank you :)

© Programmers or respective owner

Related posts about learning

Related posts about education