Forum: Ruby on Rails 14.2 confusion/This used to work

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C6c6d0d2160a6811ff4409d678c11db9?d=identicon&s=25 sean (Guest)
on 2005-11-12 12:50
(Received via mailing list)
ok this worked previously...

i am getting:


  NoMethodError in Admin/todo#live_search

undefined method `paginate_collection' for
#<Admin::TodoController:0x815a818>

what is the error here?

i have:

admin/todo_controller.rb

class Admin::TodoController < Admin::BaseController
  ..snip..

  def live_search
    @search = @params[ :search ] || @request.raw_post
    @pages, @items = paginate_collection TodoItem.search( @search,
:include => [ :assigned_to ] ), { :per_page => 15, :page =>
params[:page] }
    render :action => 'live_list', :layout => false
  end

  ..snip..
end

admin/base_controller.rb

class Admin::BaseController < ApplicationController
 .. snipped...
end

application.rb

class ApplicationController < ActionController::Base
  def paginate_collection(collection, options = {})
    default_options = {:per_page => 10, :page => 1}
    options = default_options.merge options

    pages = Paginator.new self, collection.size, options[:per_page],
options[:page]
    first = pages.current.offset
    last = [first + options[:per_page], collection.size].min
    slice = collection[first...last]
    return [pages, slice]
  end
end
6edd67c92a1dab5eb23fed79f3c18564?d=identicon&s=25 david.heinemeier (Guest)
on 2005-11-12 13:42
(Received via mailing list)
> i am getting:
>
>
>   NoMethodError in Admin/todo#live_search

Hi Sean. Please use dev.rubyonrails.org to create a ticket for bugs.
Thanks.
--
David Heinemeier Hansson
http://www.loudthinking.com -- Broadcasting Brain
http://www.basecamphq.com   -- Online project management
http://www.backpackit.com   -- Personal information manager
http://www.rubyonrails.com  -- Web-application framework
C6c6d0d2160a6811ff4409d678c11db9?d=identicon&s=25 sean (Guest)
on 2005-11-12 19:00
(Received via mailing list)
so this is a bug.

now that i know its a bug, i shall put in a ticket.
This topic is locked and can not be replied to.