I’m a total rails newbie, but I’m learning fast. I have a question that
I can’t seem to find an answer for:
What is the best way of coding views that represent foreign key
For example, while developing, I’ve created an “articles” table. I
create some scaffolding code and modify it all to look nice. I then
realise, I need an article_categories related table.
I make the change in the database, modify the models with the
“belongs_to” and “has_many”, but what is the best way to update my views
(edit/new in particular)?
I want to have a drop-down list when editing or creating an article that
allows me to select a category.
There is an example in the Agile book, but that refers to an array. I
also found an example in the onlamp tutorials, but that doesn’t use the
“_form.rhtml” file, which I think would work better.
Is there a recommended way to do this?