Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

protected method `url_for' called for LinkRenderer

#207

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

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

State: resolved
Milestone: none
Assigned to: Mislav Mislav

Activity

  1. Mislav
    Mislav
    • 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

    April 16th, 2008 @ 10:03 AM

  2. Irfan Baig
    Irfan Baig

    :(

    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'

    April 17th, 2008 @ 02:10 AM

  3. Mislav
    Mislav
    • 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.

    April 19th, 2008 @ 05:46 PM

  4. Steen Lehmann
    Steen Lehmann

    Reported in the JRuby JIRA as:

    http://jira.codehaus.org/browse/...

    I submitted a patch to JRuby for the issue yesterday.

    May 7th, 2008 @ 10:14 AM

  5. Mislav
    Mislav
    • State changed from invalid to resolved
    • Tag set to jruby, will_paginate

    January 10th, 2013 @ 04:08 AM

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.