'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.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source