Rails 2 and broken render_text
Looks like that in Rails 2, in addition to changing the default database, default sessions store, now some of the oldies such as render_text method no longer work as expected. If you’ve used render_text "some text" in a controller, then you’ll need to replace it with render :text => "some text".
March 10, 2008 at 7:48 pm
Thanks, just what I was looking for!
April 2, 2008 at 8:12 pm
Thanks…
April 22, 2008 at 10:07 pm
Thanks. I love Google. And now I love you.
May 31, 2008 at 7:09 pm
I haven’t moved up to Rails 2 yet, because of the many incompatibilities I keep reading about. In fact, I kinda suspect that Rails 2 may well kill Rails because folks like me won’t move up to v2 and will instead move on to other technologies for our next projects.
Meanwhile, though, for those who’ve been suckered into upgrading existing projects that use render_text to Rails 2, it should be possible to re-created it with the following at the end of config/environment.rb (untested, as I don’t run Rails 2):
class ActionController::Base # :nodoc
def render_text(text = nil, status = 200, append_response = false) #:nodoc:
render :text => text, :status => status, :append_response => append_response
end
end
June 28, 2008 at 6:20 pm
So much for backward compatibility! Can we stop changing things? this kind of migration has caused me more than one headache with rails and ruby!!!! If ruby and rails are so “great”, why this stupidity?