I know this is probably super simple, but for some reason I just can’t
What I want to do is click on a post and display all the categories that
post is in.
class Post < ActiveRecord::Base
class Category < ActiveRecord::Base
In the categories_controller I have this:
@post = Post.find(params[:id])
@categories = Category.find_all(params[:post])
In the list_all_categories view:
<% @categories.each do |cat| %>
<% end %>
The problem is that all the categories are showing up, instead of just
designated one(s). I tried using just the ‘find’ method, but that didn’t
work either. Any thoughts/ideas?