How do I get params from a form to use with a paginator?
debug(params) shows this
city: !map:HashWithIndifferentAccess
id: “1”
but in my controller, when I try to use @hotel_pages = Paginator.new self, Hotel.count(:conditions =>
“hotels.city_id = params[:city][:id]”), 3, @params[‘page’]
it doesn’t work. I suppose it’s a simple syntax error but have no idea
to fix it.
but in my controller, when I try to use @hotel_pages = Paginator.new self, Hotel.count(:conditions =>
“hotels.city_id = params[:city][:id]”), 3, @params[‘page’]
it doesn’t work. I suppose it’s a simple syntax error but have no idea
to fix it.
but in my controller, when I try to use @hotel_pages = Paginator.new self, Hotel.count(:conditions =>
“hotels.city_id = params[:city][:id]”), 3, @params[‘page’]
Thanks Dr Nic, I replaced :page => @params[‘page’] by :parameter =>
‘page’ and it works but only for the first page, then I have an error
You might have expected an instance of Array.
The error occured while evaluating nil.[]
Thanks Dr Nic, I replaced :page => @params[‘page’] by :parameter =>
‘page’ and it works but only for the first page, then I have an error
You might have expected an instance of Array.
The error occured while evaluating nil.[]