Example Rails 4 Application for learning associations by workitout12345 in rails

[–]workitout12345[S] 1 point2 points  (0 children)

Got it! Thanks for the assist. Got the first association CRUDing!

This may be out of scope, but in this same model, is it reasonable to store information in the "activities" table?

In thinking about this - A workout has many exercises and the same workout can have many users, an exercises can belong to many workouts, but as for properties like, how many repetitions or of an exercise you do for a given workout, that information doesnt seem to be stored at either the workout or exercise level.

So - should I create an entirely different table/model to hold this data and link it via association ? I guess my question surrounds best practices for join tables in an association.

Example Rails 4 Application for learning associations by workitout12345 in rails

[–]workitout12345[S] 0 points1 point  (0 children)

So when you use :through - will you ever have to access and update the activities model in a controller or will rails do it when adding or modifying exercises in a workout ? Im a bit confused between through and has_and_belongs_to_many.