RailsCasts Pro episodes are now free!

Learn more or hide this

Martin Burke's Profile

GitHub User: mahtyb-gmail

Comments by Martin Burke

Avatar

Is there a way to display a text field when a checkbox is checked? Say you want to add more info about that product in the join model. You check "Board Game" and you want to comment that "Settlers of Catan is a great Board Game for ages 5 - Adult" (or something like that). You also check "Toys & Games" and want to add "A Great Christmas Gift". This would update a field in the join model table called "Comments". The data in the join model would now be

ID 1
product_id 1
category_id 1
comment "Settlers of Catan..."

ID 2
product_id 1
category_id 6
comment "A Great Christmas ..."

My question is, how do you store extra info in the join model and extract that out later?

Thanks.