doni | 24 Jun 09:15
Picon
Favicon

Mau tanya tentang paginate

saya punya code nih yang error

undefined method `paginate' for #<ArticlesController:0x47052ac>

app/controllers/articles_controller.rb:5:in `index'

dan ini code nya

def index
	if params[:category_id]
		@articles_pages, @articles = paginate(:articles,:include => :user,:order => 'published_at
DESC',:conditions => "category_id=#{params[:category_id].to_i} AND published=true")
	else
		@articles = Article.find_all_by_published(true)
		@articles_pages, @articles = paginate(:articles,:include => :user,:order => 'published_at
DESC',:conditions => "published = true")
	end
		respond_to do |wants|
		wants.html
		wants.xml { render :xml => @articles.to_xml }
		wants.rss { render :action => 'rss.rxml', :layout => false }
		wants.atom { render :action => 'atom.rxml', :layout => false }
	end
end

undefined method `paginate' for #<TopicsController:0x46fcfbc>

app/controllers/topics_controller.rb:6:in `index'

def index
@forum = Forum.find(params[:forum_id])
@topics_pages, @topics = paginate(:topics,:include => :user,:conditions => ['forum_id = ?',
@forum],:order => 'topics.updated_at DESC')
respond_to do |format|
format.html # index.rhtml
format.xml { render :xml => @topics.to_xml }
end
end

udah mentog banget nih, kawan2 yang bisa bantu saya minta tolong kasih tau errornya sebelah mana atau saya
harus tambah will_paginate plugin???

------------------------------------

ID-Ruby
Berdiskusi dan belajar bersama Bahasa Pemrograman Ruby, termasuk segala varian Ruby (JRuby, Rubinius,
IronRuby, XRuby), dan program yang dibuat dengan Ruby (Ruby on Rails, JRuby on Rails, Merb)

<*> Kunjungi *arsip milis* id-ruby di
    http://groups.yahoo.com/group/id-ruby/messages
    http://www.mail-archive.com/id-ruby-hHKSG33TihhbjbujkaE4pw <at> public.gmane.org/
    http://rubyurl.com/Q8DD
    http://news.gmane.org/gmane.comp.lang.ruby.region.indonesia

<*> Baca peraturan id-ruby sebelum posting
    http://rubyurl.com/gay1

<*> Ikutilah Jajak Pendapat ID-Ruby
    http://rubyurl.com/3CCt

<*> Links ID-Ruby
    http://rubyurl.com/n96r

<*> Database ID-Ruby
    http://rubyurl.com/Iw3u

<*> Kunjungi Situs Resmi Ruby Indonesia
    http://www.ruby-lang.org/id/

<*> Join Ruby Indonesia on Facebook
    http://rubyurl.com/QV48

<*> Join Ruby Indonesia on LinkedIn
    http://rubyurl.com/eh0i

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/id-ruby/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/id-ruby/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:id-ruby-digest@... 
    mailto:id-ruby-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    id-ruby-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/


Gmane