从Rails控制台调用ActionController方法
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了从Rails控制台调用ActionController方法相关的知识,希望对你有一定的参考价值。
The 'request' and 'response' objects are chock full of useful info. But console can't usually access them. Here's how:start the server with the -u option, insert a breakpoint where you would like to have access to the controllers/helpers/etc. When finished, just type 'cont' to continue execution
# terminal script/server -u # /some/view.erb <% debugger %> # open the url associated with that view, and switch over to the terminal to play with ActionController methods and objects (rdb:2) request
以上是关于从Rails控制台调用ActionController方法的主要内容,如果未能解决你的问题,请参考以下文章
从 Rails 中的控制器调用辅助方法时出现“未定义的方法”