Bug with :entry_name for page_entries_info? #200

Justinwceo opened this Issue Nov 16, 2011 · 4 comments

6 participants


For some strange reason the parameter isn't working:

<div id="search-pagination" class="grid_24">
    <div class="digg_pagination">
        <% if @user_prices.length > 0 && @user_prices.total_pages > 1 %>
        <div class="page_info">
            <%= page_entries_info @user_prices, :entry_name => "Product", :plural_name => "Products"  %>
      <% end %>
    <%= will_paginate @user_prices, :container => false %>

It never goes to Product and Products, it just stays at User price. Is this some bug or what am I doing wrong?

These are my gems:

gem 'rails', '3.0.9'
gem 'sunspot_rails'
gem 'will_paginate', '3.0.2

same issue here.


I experienced the same issue but went digging in the code to figure out what was going on. This is not a bug, this is a change to will_paginate that was introduced in this commit.

The correct way to deal with this now is to use a locale file. See https://github.com/mislav/will_paginate/wiki/I18n

So, for your user_price issue you probably want something like this in your project's config/locales/en.yml file:

        zero: products
        one: product
        few: products
        other: products

Thank you, this fixed it.

@mislav mislav closed this Jan 10, 2013

As far as I can tell, the easiest 'fix' for :entry_name not working is replace it with :model (in our app, we sometimes want our 'Beep' model to be called 'comment' and sometimes 'review', so hardwiring the entry name into locale isn't as flexible as being able to use page_entries_info and :model => 'whatever we want'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment