I have a Post and Tag model.
I would like to show the first 20 instances of the Tag model in the index view of the Post model.
(Pretty much what you see in StackOverflow’s home page in the sidebar).
What’s the best way of doing this?
(by the way, I’m using will_paginate)
EDIT:
I tried adding render 'tags/index in the posts index view, created a index.html.erb file in views/tags.
But I’m getting this:
Showing /home/alex/rails/r18/app/views/layouts/_sidebar.html.erb where
line #14 raised:Missing partial tags/index with {:locale=>[:en], :formats=>[:html],
:handlers=>[:erb, :builder, :coffee]}. Searched in: *
“/home/alex/rails/r18/app/views” *
“/home/alex/.rvm/gems/ruby-1.9.2-p290/gems/ckeditor-3.7.0.rc3/app/views”
* “/home/alex/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/app/views”
The first or the most recent?
Shows the first 20 tags.