I am fairly new to Ruby and Rails, made a few blogs etc. I am slowy learning the ruby language and rails framework. I am wanting to create a workout journal/tracker application and need help establishing the models and or to get me started on the right path. I basically want to be able to create a workout/different types of workouts (back, arms, legs, etc), be able to use the # of sets and reps used for that workout, how many days/which days a week, add, edit, delete the workouts, track weight loss/weight, track the workouts, reps, sets you did prior, set goals in the journal, track progress, eventually be able to share workouts etc. I know what I am looking to do just need help getting started and establishing what models to use and what associations to use. I know it seems like alot of info. Any help getting at all getting going would be awesome. Thanks all!
Share
This might be a bit tricky, since there are many styles of exercises — N sets of M reps, pyramid, max lifts, etc. You may want polymorphic associations in the final version.
But I think you’ll have a more clear vision of where to take the project once you’ve built a few tables and classes; I think I’d start with a
Workoutclass thathas_manyWOSets(don’t useSet; having class names that conflict with built-in class names is way more irritating than you may think), and eachWOSethas_manyReps. Then yourRepswill keep track of count and weight. Store the order of the reps in theWOSet.You’ll also need a
Stationclass for all the machines and exercises; probably yourWOSetwillbelongs_totheStation, and theStationwillhas_manyWOSet. (So you can retrieve all the sets ever performed on a specific station.)I hope this quick sketch gets you to the point of playing with creating new workouts, new stations, and playing with the interface in
script/console.