thisivan / flow_pagination

Twitter like pagination renderer gem for WillPaginate
MIT License
100 stars 5 forks source link

still fails with rails 3? #7

Open inspire22 opened 13 years ago

inspire22 commented 13 years ago

I replied to an older closed issue, but I don't think you saw it so trying as a new one.

Also, more docs about what to put in the .rjs file/etc would be handy. The example gives an idea, but I'm not sure that everyone clicks over to there.

Finally got around to trying this - now I'm getting a new error on the line that renders the pagination.

undefined method `total_pages_for_collection' for WillPaginate::ViewHelpers:Module Callback:

/Users/inspire/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/flow_pagination-6884aa57882a/lib/flow_pagination.rb:48:in last_page' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/flow_pagination-6884aa57882a/lib/flow_pagination.rb:12:into_html' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/will_paginate-b1a5beeec9f5/lib/will_paginate/view_helpers/base.rb:63:in will_paginate' /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/will_paginate-b1a5beeec9f5/lib/will_paginate/view_helpers/action_view.rb:33:inwill_paginate' actionpack (3.0.3) lib/action_view/template.rb:135:in send' actionpack (3.0.3) lib/action_view/template.rb:135:inrender' activesupport (3.0.3) lib/active_support/notifications.rb:54:in instrument' actionpack (3.0.3) lib/action_view/template.rb:127:inrender' actionpack (3.0.3) lib/action_view/render/rendering.rb:59:in _render_template' activesupport (3.0.3) lib/active_support/notifications.rb:52:ininstrument' activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (3.0.3) lib/active_support/notifications.rb:52:ininstrument' actionpack (3.0.3) lib/action_view/render/rendering.rb:56:in _render_template' actionpack (3.0.3) lib/action_view/render/rendering.rb:26:inrender_without_haml' haml (3.0.25) lib/haml/helpers/action_view_mods.rb:13:in `render'

thisivan commented 13 years ago

Hi Inspire,

I think that Maximiliano (maxguzenski) is right. There's no need for a renderer like mine anymore. It far more easy to do it with pure JavaScript. So I'm gonna declare this project death for Rails 3.

Even so, I'm updating "flow_pagination_example" with Rails 3 and no special renderer. Instead I'm gonna provide a jQuery plugin to solve the same problem. I started this morning and I think can be ready for tomorrow.

What do you think?

thisivan commented 13 years ago

Second thought, I'm still gonna fix it. So, it will be ready by tomorrow. Also, I'm gonna fix the other issue, multiple pagination in the same page.

Any other ideas for FlowPagination?

inspire22 commented 13 years ago

um, i think the other half of my problem is that I'm using the jquery rails.js - which doesn't seem to support .rjs??? sigh!

inspire22 commented 13 years ago

ah i've been kinda able to figure this out now by doing .js.haml and just writing it in jquery with .html( #{ render :collection => @objects} ) / etc

shreya commented 13 years ago

Hi Inspire,

I'm stuck with same problem. undefined method `total_pages_for_collection' for WillPaginate::ViewHelpers:Module

Could you let me know did you resolve it? I have the following in my index.js.erb - $('#d_list').append("<%= escape_javascript(render(:partial => @deals)) %>") $('#flow_pagination').html("<%= will_paginate(@deals, :renderer => FlowPagination::LinkRenderer) %>")