views:

30

answers:

0

will_paginate produces escaped html, what am I missing here. I've verified that will_paginate producted html_save code, I've tried adding will_paginate(@pictures).html_safe as well. Note that page_entries_info works as it should, its just the main helper that is messed up. For the time being I've done the code manually, but for obvious reasons I would prefer to use the proper helper for this.

controller:

class PicturesController < ApplicationController
  # GET /pictures
  # GET /pictures.xml
  def index
    @pictures = Picture.recent.paginate(:page => params[:page], :per_page => 4)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @pictures }
    end
  end
end

view:

<% @pictures.each_with_index do |picture, i| %>
  <%= link_to(picture_image_tag(picture, "small"), picture, :class => "picture grid_2 " + nine_sixty_alpha_omega(i, 4)) %>
<% end %>
<div class="clear"></div>

<%=raw will_paginate(@pictures) %>
<%= @pictures.total_pages %>
<%=raw  page_entries_info(@pictures) %>

Gemfile:

source 'http://rubygems.org'
gem 'rails', '3.0.0.beta3'
gem "mongoid", "2.0.0.beta4"
gem "bson_ext", "0.20.1"
gem 'will_paginate', '3.0.pre', '>= 3.0.pre'
#gem 'agnostic-will_paginate'#, :require => 'will_paginate' 
gem 'mongo'

Output:

<span class="disabled prev_page">&amp;laquo; Previous</span> <span class="current">1</span> <a href="/pictures?page=2" rel="next">2</a> <a href="/pictures?page=2" class="next_page" rel="next">Next &amp;raquo;</a>
2 Displaying pictures 1 - 4 of 6 in total