#207 ✓resolved
Andrew Shika

protected method `url_for' called for LinkRenderer

Reported by Andrew Shika | April 14th, 2008 @ 01:41 AM

I have <%= will_paginate @events %> in my view and @events = Event.paginate :page => params[:page], :per_page => 2, :order => 'event_start_datetime DESC' in my controller.

The view throws the following exception.

protected method `url_for' called for #

I am using will_paginate 2.2.1, JRuby on Rails 1.1

Comments and changes to this ticket

  • Mislav

    Mislav April 16th, 2008 @ 10:03 AM

    • Assigned user changed from “Chris Wanstrath” to “Mislav”
    • Title changed from “protected method `url_for' called for #<WillPaginate::LinkRenderer:0x89b54b>” to “protected method `url_for' called for LinkRenderer”

    Uh ... The url_for method is indeed protected, but it's called from within the object itself (so it doesn't matter if it's protected or even private).

    Can you give me more info? Like, paste the stack trace (mark it up as code block). Thanks

  • Irfan Baig

    Irfan Baig April 17th, 2008 @ 02:10 AM


    ActionView::TemplateError (protected method `url_for' called for #) in search/paged_search.html.erb:

    /usr/local/jruby-1.1RC3/lib/ruby/gems/1.8/gems/will_paginate-2.2.1/lib/will_paginate/view_helpers.rb:250:in `page_link_or_span'

    /usr/local/jruby-1.1RC3/lib/ruby/gems/1.8/gems/will_paginate-2.2.1/lib/will_paginate/view_helpers.rb:212:in `windowed_links'

    /usr/local/jruby-1.1RC3/lib/ruby/gems/1.8/gems/will_paginate-2.2.1/lib/will_paginate/view_helpers.rb:209:in `each'

    /usr/local/jruby-1.1RC3/lib/ruby/gems/1.8/gems/will_paginate-2.2.1/lib/will_paginate/view_helpers.rb:209:in `inject'

    /usr/local/jruby-1.1RC3/lib/ruby/gems/1.8/gems/will_paginate-2.2.1/lib/will_paginate/view_helpers.rb:209:in `windowed_links'

    /usr/local/jruby-1.1RC3/lib/ruby/gems/1.8/gems/will_paginate-2.2.1/lib/will_paginate/view_helpers.rb:175:in `to_html'

    /usr/local/jruby-1.1RC3/lib/ruby/gems/1.8/gems/will_paginate-2.2.1/lib/will_paginate/view_helpers.rb:98:in `will_paginate'

    app/views/search/paged_search.html.erb:9:in `_run_erb_47app47views47search47paged_search46html46erb'

  • Mislav

    Mislav April 19th, 2008 @ 05:46 PM

    • State changed from “new” to “invalid”

    Uhh ... seems like JRuby bug. The method is called from LinkRenderer instance itself, so it couldn't possibly error out.

    I'm closing for now, but you're free to provide more info if you find any. You're also welcome to try to work around this.

  • Steen Lehmann

    Steen Lehmann May 7th, 2008 @ 10:14 AM

    Reported in the JRuby JIRA as:


    I submitted a patch to JRuby for the issue yesterday.

  • Mislav

    Mislav January 10th, 2013 @ 04:08 AM

    • State changed from “invalid” to “resolved”
    • Tag set to jruby, will_paginate

    (from [8738d80c20f0fa4639d693c7986027f33ab5e5f7]) use total_entries in page_entries_info() consistently

    Fixes #278, fixes #284, fixes #207

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Everyone's favorite Ruby library for pagination of practically anything!