I would be able to paginate easily but I'm using two models which complicates it a bit.
First here's the controller
class BrowseController < ApplicationController
def index
@hashtags = Hashtag.find(:all, :order => 'created_at DESC')
@posts = post.all
end
end
Then here's the view (browse\index.html.erb)
<ul>
<% @posts.each do |post| %>
<% if post.hashtags.present? %>
<li> <%= link_to post.hashtags.map{|h| "##{h.hashtags}"}.join(', '), post.user %> </li>
<% else %>
<% end %>
<% end %>
</ul>
I'm trying to paginate that view. It's not just post, but the hashtag of the posts. What would be the correct <%= will_paginate %>
code?
I'm trying to paginate the hashtags of the posts, not just the posts themselves.