【发布时间】:2010-09-14 00:55:58
【问题描述】:
在rails console中,可以这样做:
ree-1.8.7-2010.02 > helper.number_to_human_size 1
=> "1 Byte"
ree-1.8.7-2010.02 > helper.number_to_human_size 100000
=> "97.7 KB"
ree-1.8.7-2010.02 > helper.number_to_human_size 0
=> "0 Bytes"
ree-1.8.7-2010.02 > helper.number_to_human_size 100000000
=> "95.4 MB"
但是在rails runner 中呢?它作为控制器运行吗?当我打印出self.class 时,它只显示Object
【问题讨论】:
标签: ruby-on-rails-3 actionview