I've implemented a tagging system into my app so that posts can have different tags applied to them. I am rendering the posts with a certain tag like this
<% my_posts = post.find_by_tag("sports") %>
<%= my_posts.each do |post| %>
<%= post.title %><br />
<%= post.body %><br />
<% end %>
the only problem is that it will only render in my _post.html.erb partial or in my show.html.erb
when I try to create another partial for instance like _fact.html.erb it does not render
This is the posts controller for the page that it does work on
def newest
@posts = Post.paginate(:page => params[:page], :per_page => 10)
@title = "Newest"
@vote = Vote.new(params[:vote])
respond_to do |format|
format.html
format.json { render :json => @users }
end
end
and in the newest view I just did a <% render :partial => @posts %>
I wanted to do the same thing except with def sports and a view that is sports.html.erb but for some reason when I do that and use another partial besides @posts it doesn't work. I've already added a line in the def sports for @facts so thats not it but I'm not sure what the problem could be.
Still new to programming so any help would be greatly appreciated, thank you.