I’m not sure why i am having this problem but when i execute a call to
the calls controller from a link
I get the following error
NoMethodError in CallsController#index
undefined method `_of’ for #Class:0x2517c1c
RAILS_ROOT: /Users/owenhmad/Sites/ministrytrackr/ministrytrackr
Application Trace | Framework Trace | Full Trace
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/
base.rb:1532:in method_missing_without_paginate' /Library/Ruby/Gems/1.8/gems/mislav-will_paginate-2.3.2/lib/ will_paginate/finder.rb:164:in
method_missing’
app/models/call.rb:23
/Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/
dependencies.rb:203:in load_without_new_constant_marking' /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:203:in
load_file’
/Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/
dependencies.rb:342:in `new_constants_in’
part of my CallsController is
class CallsController < ApplicationController
before_filter :login_required, :only => [ :index, :new, :edit]
def index
@calls = Call.find(:all)
@recent_calls = @current_user.calls.find(:all)
@recent_calls = @current_user.calls.search(params[:search],
params[:page])
end
def list
@calls = @current_user.calls.find(:all)
end
def show
@call = Call.find(params[:id])
end
And my call model is
class Call < ActiveRecord::Base
belongs_to :user
has_many:visits, :dependent => :destroy
has_many:visits do
def latest
find :all, :order => ‘id DESC’, :limit => 3
end
def all_latest
find :all, :order => 'id DESC'
end
end
def self.search(search, page)
paginate :per_page => 4, :page => page,
:conditions => [‘name like ?’, “%#{search}%”],
:order => ‘name’
end
end
It says in the error message `method_missing_without_paginate’
I have will_paginate installed in rails as a gem and it shows up in my
gem list. Any help to a beginner working on first real app after may
books would be appreciated
Thanks Owen