The rails have a "response.write", you want to make a quick conclusion from the action

From in action (and not in view), I want to output quick debugging code.

Does the rails have a method for this?

in asp.net I would do:

Response.Write("hello");
+3
source share
2 answers

It will be like this:

render :text => "hello"

You can only call the render or redirect once for one request, just FYI.

+1
source

You can also use a registrar. Placed

logger.info "text"
logger.info @var

somewhere in action. And thentail -f log/development.log

This way, you will not interfere with the normal rendering process, since you can only use it once.

+6
source

Source: https://habr.com/ru/post/1772347/


All Articles