c42 / pox_paginate

Transparent support for pagination using WillPaginate and ActiveResource over POX (Plain Old Xml)
http://c42.in/open_source
Other
34 stars 14 forks source link

Doesn't install with rails 3.0.4 #5

Open brodock opened 13 years ago

brodock commented 13 years ago

Bundler could not find compatible versions for gem "activesupport": In Gemfile: rails (= 3.0.4) depends on activesupport (= 3.0.4)

pox_paginate (~> 0.2.1) depends on
  activesupport (3.0.3)
kaiwren commented 13 years ago

Could you try that with gem 'pox_paginate', '~> 0.2.2' instead of gem 'pox_paginate', '~> 0.2.1'

0.2.2 is set up to work with all Rails 3.0.x. Let me know if that fixes it for you.

brodock commented 13 years ago

This seens to work... but pox looks like not working correctly.

I've started to debug it and it looks likes total_pages is not retrived correctly

While trying to see a normal "index crud" page, that has a <%= will_paginate @noticias %> I get:

undefined method `<' for nil:NilClass

Looking at the stacktrace I get:

activesupport (3.0.4) lib/active_support/whiny_nil.rb:48:in `method_missing'
/Users/brodock/.rvm/gems/ruby-1.9.2-p0/bundler/gems/will_paginate-b1a5beeec9f5/lib/will_paginate/view_helpers/base.rb:110:in `page_entries_info'
/Users/brodock/.rvm/gems/ruby-1.9.2-p0/bundler/gems/will_paginate-b1a5beeec9f5/lib/will_paginate/view_helpers/action_view.rb:40:in `page_entries_info'
app/views/noticias/index.html.erb:26:in `_app_views_noticias_index_html_erb___634210951152283626_2162848200__128685990689779746'
...

Which leads to the _totalpages from will_paginate collection being returned as a NilClass

Any idea?

I tried with Will_Paginate 3.0pre2, 3.0beta and git version using rails3 branch. None of them worked.

I'm also using InheritedResource, and adapted the instructions to work fine with it:

class NoticiasController < InheritedResources::Base
  protected
    def collection
      @noticias ||= end_of_association_chain.paginate(:page => params[:page], :per_page => params[:per_page])
    end
end
preethiramdev commented 13 years ago

I created a sample application and on looking at the "index crud page" I find that the "total entries" returned matches up with the total number of entities created . So it would seem that pox is working fine. You can look at my sample app at git://gist.github.com/858431.git and perhaps give me more details so I can understand if I have replicated the bug correctly?