exercise hm:t muscles
In my controller I do @muscle_groups = MuscleGroup.all
Then in my view I do
- @muscle_groups.each do |mg|
- mg.muscles.all(:conditions => ["id not in (?)",
@exercise.muscle_ids]).each do |m|
...
I'm trying to filter out all the muscles already added to an exercise.
However this is clear bad practice. Since all this should be happening
in the controller (prehaps even in the model?)
So how do I go about filtering my active record based on values by
association? if that makes sense...
best regards,
Seb
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.