views:

24

answers:

2

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");
+1  A: 

That'd be this:

render :text => "hello"

You can only call render or redirect once for a single request, just FYI.

Ryan Bigg
thanks but once is no good!
Blankman
@Blankman If it's no good, you should post your solution and accept it. For good form's sake.
Júlio Santos
+4  A: 

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.

Júlio Santos