views:

41

answers:

1

I thought Ruby on Rails "script/console" can let me do "render :text => 'hello' " but it says render is not defined?

+3  A: 

Call render via helper:

>> helper.render :text => "foo"
=> "foo"

Check this question.

jpemberthy
`helper.number_to_currency('123.45')` works, but `helper.render :text => "foo"` doesn't
動靜能量
What version of `Rails` are you using? I tested it with `2.3.4` and `3beta3` check out this gist. http://gist.github.com/499498
jpemberthy
I am using 2.2.2 in our dev / prod environment
動靜能量
That's probably why It isn't working for you :(.
jpemberthy