Hello all.. I'm new in Ruby on Rails. I'm doing an application which needs to use pagination. This is ok. I got to use it and I didn't find any error. But I've got to put a city names "research" too. That's the problem. The pagination failed. the variable doesn't take its value. Below it's my city's list:

Aracaju Editar Excluir Borborema Editar Excluir Brasília Editar Excluir Campinas Editar Excluir Campo Largo Editar Excluir Curitiba Editar Excluir Curralinho Editar Excluir Diadema Editar Excluir Florianópolis Editar Excluir Fortaleza Editar Excluir

I want to look for all cities with letter "a". My code find them. But when I try to go to 2nd page, there is an error:

You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.

My variable doesn't take the "research". Does anybody know what I can do about that? Thanks a lot..

I'm not sure what you mean, but if you need to include the "research" variable in your form (eg. for page 2) you can use a hidden field for that purpose..

lg // andreas

Ok, thanks a lot.. I'll try that. Just to know, my problem is like described below: