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.
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
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
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