Im trying to see posts index page, In tat im showing category list, im
using collect method it show error..

ActiveRecord::StatementInvalid in Posts#index
Showing app/views/posts/index.html.erb where line #19 raised:

Mysql::Error: Unknown column 'categories_posts.category_id' in 'on
clause': SELECT `categories`.* FROM `categories`  INNER JOIN
`categories_posts` ON `categories`.id =
`categories_posts`.category_id    WHERE ((`categories_posts`.post_id =
1))

Extracted source (around line #19):

16:     <td><%= post.created_at.strftime('%m/%d/%y %I:%m %p') %></td>
17:     <td><%= h(post.title) %></td>
18:     <td><%= h(post.author.display_name) if post.author %></td>
19:     <td><%= post.categories.collect {|cat| [cat.name] }.join(",")
%>
20:     <td><%= h(post.status) %></td>
21:     <td><%= post.comments_count %>

pls help me,, im new to RoR..??
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to