Posts [ 2 ]

Topic: Forms for has_many :through associations

I'm fairly new to Rails, so any help would be greatly appreciated.

My app has two models, Song and Color, which are linked through the SongColor relationship. A song has many colors through song_color.

On the show page for Song, I want to include a form that will create a new color with the given parameters (RGB values), and link that to the song using song_color. So both a color and a song_color will be created by the form.

I'm not sure on how exactly to do this. Would using a nested form be the way to go?