Experienced Java developer, new to Rails - wondering about belongs_to relationship in scaffolding.
Saw another answer like this
and followed the rails generate scaffold_controller obj:references
pattern.
The index/show page is showing #<MyClass:xxxx>
instead of the string I want - is there a method in the target class (parent side of the belongs_to
) I need to override to specify the identifier?
Also in the edit view, it looks like it's trying to modify the reference as a string rather than as drop-down - is there something I need to specify to make that happen?
Thanks!
BTW - I was able to get similar scaffolding to work in Django and Grails, where the foreign key turned into a drop-down; I'm hoping Rails is equally easy and I'm just missing it.