# NoMethodError

**URL:** <https://www.ruby-forum.com/t/nomethoderror/117278>\
**Category:** Rails\
**Created:** [October 15, 2007, 3:44pm UTC](https://www.ruby-forum.com/t/nomethoderror/117278 "2007-10-15T15:44:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshi\_v](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@joshi\_v](https://www.ruby-forum.com/u/joshi_v)\
**Post date:** [October 15, 2007, 3:44pm UTC](https://www.ruby-forum.com/t/nomethoderror/117278/1 "2007-10-15T15:44:31Z")

</div>

Hi to all!!

I am new to ruby. I am trying to write a program to fetch the data from  
Database and written the data using pagination. I could get the data  
from DB. but pagination is not working. When i see the log file it is  
showing the following error.

NoMethodError: undefined method ‘paginatior’ #\<Hash…\>

my pginate.rb and pagination.rb files are not in the same folder

Here is my piece of code:

def sample\_method

sql = “select \* from customers where rownum \< 100”

collection = Sample::Models:🈶:Customer.find\_by\_sql(sql)  
options={:per\_page =\> 10 , Page =\> 1}

@pages, @customers = paginate\_collection(collection,options)

end

Can any one point me where i am doing the mistake. Hope any one can help  
asap.

Thanks & Regards  
joshi.

---

<div class="post-metadata">

**Author:** ![joshi\_v](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@joshi\_v](https://www.ruby-forum.com/u/joshi_v)\
**Post date:** [October 15, 2007, 4:27pm UTC](https://www.ruby-forum.com/t/nomethoderror/117278/2 "2007-10-15T16:27:40Z")

</div>

On 15 Oct 2007, at 14:44, Vijaya Th wrote:

> NoMethodError: undefined method ‘paginatior’ #\<Hash…\>  
> Sounds like that should be paginator
> 
> collection = Sample::Models:🈶:Customer.find\_by\_sql(sql)  
> options={:per\_page =\> 10 , Page =\> 1}

that probably wants to be :page

Fred

---

<div class="post-metadata">

**Author:** ![joshi\_v](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@joshi\_v](https://www.ruby-forum.com/u/joshi_v)\
**Post date:** [October 16, 2007, 8:24am UTC](https://www.ruby-forum.com/t/nomethoderror/117278/3 "2007-10-16T08:24:07Z")

</div>

Frederick C. wrote:

> > NoMethodError: undefined method ‘paginatior’ #\<Hash…\>  
> > Sounds like that should be paginator
> > 
> > collection = Sample::Models:🈶:Customer.find\_by\_sql(sql)  
> > options={:per\_page =\> 10 , Page =\> 1}
> 
> that probably wants to be :page
> 
> Fred

It is just a typo mistake ☹ Actual line is like this

options= {:per\_page =\>10 , :page =\> 1}

Thanks for the reply

---

<div class="post-metadata">

**Author:** ![joshi\_v](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@joshi\_v](https://www.ruby-forum.com/u/joshi_v)\
**Post date:** [October 16, 2007, 8:28am UTC](https://www.ruby-forum.com/t/nomethoderror/117278/4 "2007-10-16T08:28:33Z")

</div>

Frederick C. wrote:

> > NoMethodError: undefined method ‘paginatior’ #\<Hash…\>  
> > Sounds like that should be paginator
> > 
> > collection = Sample::Models:🈶:Customer.find\_by\_sql(sql)  
> > options={:per\_page =\> 10 , Page =\> 1}
> 
> that probably wants to be :page
> 
> Fred

It is just a typo mistake ☹ Actual line is like this

options= {:per\_page =\>10 , :page =\> 1}

Thanks for the reply

the same function paginate\_collection is working for another function.  
Don’t know where i am doing wrong. Any help in this matter is highly  
appreciated.

Regards,  
joshi
