About a month ago I made the move to rails 3, and I could swear my apps worked, but maybe I didn't test thoroughly. Anyway, things are broken now, and I get the message (when I try to paginate a bunch of results from a database query):
Cannot convert nil to arrayA google search on "rails paginate convert nil to array" gets a bunch of hits, and there seems to be two basic lines of advice. One is to convert to the "rails 3 right way" which doesn't seem to use will_paginate -- someday we will tackle this. The other line of advice is that I need to use a certain version of will_paginate and I am advised to add the following to my Gemfile:
gem 'will_paginate', '3.0pre2'Before I do this, I simple do a bundle update, but this does not solve the problem (it installs will_paginate 3.0.0), so I do as instructed and follow up with:
bundle updateThis time it tells me it is Using will_paginate (3.0.pre2). I don't see things fixed, so I restart my webserver and voila, this pagination issue is fixed (another issue now rears its ugly head - such is the rails way).
<td><%= text.html_safe %></td>And after this, I was satisfied. Apparently the html_safe method sets an attribute on the string telling rails not to screw with it later.
Ruby on Rails notes / [email protected]