I’m ashamed to ask this but I can’t figure it out. Lately my brain gets
more burned out by the minute. Basically I’m trying to have a shirt have
up to 2 colors. I currently have this working. When I edit a shirt, I
can select the primary and secondary color of a shirt. But when I want
to see the colors in the show page I can’t manage to see the name only
<%=h @shirt.color_id %>
<%=h @shirt.color2_id %>
Only displays the id (obviously) but what I want to see is the NAME OF
THE COLOR. I just can’t think of a way to do this for some reason. Maybe
there is a better way to do this and you guys can shed a light?
Below is the database structure and model relationship code…
APPROVED_COLORS (table name/structure in db)
SHIRTS (table name/structure in db)
Any help on this is greatly appreciated.