Displaying 1 result from an estimated 1 matches for "contents_related".
2006 Mar 13
5
Displaying related entries by tags - HELP!
...<%= post.tags.collect { |tag| link_to tag.name, :controller =>
"articles", :action => "by_category", :category => tag.name.to_s
}.join(", ") %>
<p><%= post.entry %></p>
<% end %>
#layout
<% for related in @contents_related %>
<li><%= related.title %><br /></li>
<% end %>
#controller (how do I pass the tag_id and the content_id?)
@contents_related = Content.show_related_entries(?,?)
#model
def self.show_related_entries(t_id, c_id)
find_by_sql("select c.title from contents...