Can you help me solve this problem? I’ve not managed to find any documentation on this, no doubt because it’s such a simple thing that no one’s thought to write it down!
I’m debugging some oauth functionality in a Rails app, and needing to regularly refer to the access token, which I’m rendering as text to_yaml.
render :text => request.env["omniauth.auth"].to_yaml
Is there a quick way to format the response? I currently have one long array displayed in my browser, which makes reading very challenging!
Can I get each item to display on a separate line, ideally nested under parent items?
For example, currently I have this: --- provider: twitter uid: '#####' info: nickname: username name: User Name and I want this:
---
provider: twitter
uid: '#####'
info:
nickname: username
name: User Name
I’m sure I’m overlooking something very obvious. Appreciate if someone can point it out to me!
Thanks!
Use the magic
pretag:EDIT: Better fit for your example:
If you use this a lot, refactor it into a helper method somewhere.