Displaying 2 results from an estimated 2 matches for "article_category".
2006 Feb 11
1
Naming confusion
Hi,
I have a database setup with 2 tables and a simple one-to-many
relationship where
article_categories have many articles.
In the models ruby has created for me, I''ve added "belongs_to
:article_category" to the Article class and "has_many :articles" to
the ArticleCategory class.
Everything seems fine until I try to reference the category from the
article. In my view for example, I have
"@article.article_category.name", but this throws an error..
------
You have a nil ob...
2006 Jan 05
2
Rails Newb: Foreign Key Views?
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
relationships?
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