我想看看我的視圖中的變量編碼出了什麼問題。所以我啓動了滑軌控制檯並試圖做在rails控制檯中使用像html_escape這樣的幫助器方法
$ rails console
Loading development environment (Rails 3.2.11)
irb(main):001:0> html_escape({:a=>1, :b=>"my str"})
NoMethodError: undefined method `html_escape' for main:Object
如何在rails控制檯中使用h或html_escape?
downvoter的前控制檯,請告訴我們,什麼是錯的,所以我們可以學習。 – highBandWidth 2013-03-01 22:58:40
看起來像今天我得到了一些。 – jvnill 2013-03-02 00:21:50
非常有用的提示! – jmoreira 2014-09-09 13:06:15