From within an action (not the view), I want to output some quick debug code.
Does rails have a method for this?
in asp.net I would do:
Response.Write("hello");
From within an action (not the view), I want to output some quick debug code.
Does rails have a method for this?
in asp.net I would do:
Response.Write("hello");
That'd be this:
render :text => "hello"
You can only call render or redirect once for a single request, just FYI.
You may also use the logger. Put
logger.info "text"
logger.info @var
somewhere on the action. And then tail -f log/development.log
This way you won't interfere with the normal rendering process, since you can only use render once.