I have two models.
Whenever I do this, I get error (uninitialized constant
<%= post.blog_categories.name %>
Post is variable which continue one row from the blog_post table.
BUT when I write this, it works, but this is bad to have it in the view
<%= BlogCategory.find_by_id(post.blog_category_id).name %>
Anyone knows why I’m getting:
uninitialized constant BlogPost::BlogCategories?
and thanks many times