script/consoleでアクションを実行。
$ ./script/console Loading development environment (Rails 2.1.2) >> app.get "/" => 200 >> app.response
script/consoleでヘルパーメソッドを実行。
$ ./script/console Loading development environment (Rails 2.1.2) >> foo = ActionView::Base.new => #<ActionView::Base:0x220c310 @controller=nil, @finder=#<ActionView::TemplateFinder:0x220c2c0 @view_paths=[], @template=#<ActionView::Base:0x220c310 ...>>, @assigns_added=nil, @assigns={}> >> foo.extend ApplicationHelper => #<ActionView::Base:0x220c310 @controller=nil, @finder=#<ActionView::TemplateFinder:0x220c2c0 @view_paths=[], @template=#<ActionView::Base:0x220c310 ...>>, @assigns_added=nil, @assigns={}> >> foo.your_helper_method(args) => "<html>created by your helper</html>" >> foo.extend YourHelperModule => #<ActionView::Base:0x220c310 @controller=nil, @finder=#<ActionView::TemplateFinder:0x220c2c0 @view_paths=[], @template=#<ActionView::Base:0x220c310 ...>>, @assigns_added=nil, @assigns={}> >> foo.your_helper_method(args) => "<html>created by your helper</html>"
script/console で URL がどんな params に認識されるかを確かめる - d.hatena.ne.jp/jun66j5/
Firing A Controller's Action From The Console | DZone
Misuse » Firing Rails Controller Actions from Command line (console)
How do I call controller/view methods from the console in Rails? - Stack Overflow
あてずっぽでやったら、「helper」をレシーバにすれば実行できた。
$ script/console
Loading development environment (Rails 2.1.2)
>> helper.number_to_human_size(1024*1500)
=> “1.5 MB”
>> exit