mardi 19 avril 2022

session.inspect output with propper indentation in rails

Using p session.inspect outputs a single line. I want to add a html-container in my application view, always showing what's inside the session. But this should be properly formatted with indentations and breaks. Is there a way to achieve this?

In PHP, e. g., you can wrap the output of $_SESSION in a <pre>-tag and it will automatically be properly formatted.

Aucun commentaire:

Enregistrer un commentaire