When I visit the gym search page,
When I see a gym that I am a member of,
the gym card shows as a different color.
(or has some indication that I am a member of this gym, whichever is more feasible)
Note:
We could update the Gym Search endpoint to send meta information along with each gym in the GymSerializer.
That meta information would be a hash key that says whether the user is a member of the gym or not.
Method in the serializer as something like:
meta do |gym|
{
member: gym.member?
}
end
And then some #member? method in the User or GymMembership model.
And then some conditional in the view to decide which CSS formatting to use for the Gym card.
When I visit the gym search page, When I see a gym that I am a member of, the gym card shows as a different color. (or has some indication that I am a member of this gym, whichever is more feasible)
Note: We could update the Gym Search endpoint to send
meta
information along with each gym in theGymSerializer
.That
meta
information would be a hash key that says whether the user is a member of the gym or not.Method in the serializer as something like:
And then some
#member?
method in the User or GymMembership model.And then some conditional in the view to decide which CSS formatting to use for the Gym card.
See @tvaroglu or @Scott-Borecki for help with using
meta
in the the serializer. Or check out the jsonapi-serializer docs: https://github.com/jsonapi-serializer/jsonapi-serializer#meta-per-resource