awesome-print / awesome_print

Pretty print your Ruby objects with style -- in full color and with proper indentation
http://github.com/michaeldv/awesome_print
MIT License
4.07k stars 454 forks source link

Sinatra with Slim; unable to ap to view #203

Open kaldrenon opened 9 years ago

kaldrenon commented 9 years ago

In my Slim view I have

= ap @summaries, html: true

Per https://github.com/michaeldv/awesome_print#actionview-convenience-method I hoped this would render the output as HTML inside the view, but instead it printed the object's contents as HTML into the console.

Is my syntax incorrect, or does awesome_print not support Slim?

D-side commented 9 years ago

Your syntax is correct, but the helper method is defined for Rails' ActionView::Base, so it's not visible in Sinatra's templating system. It's not Slim's fault.

I've tried using "awesome inspect" instead like so (mimicking your example):

@summaries.ai(html: true)

...but that fails too, albeit for a different reason (#137). I've found a dirty fix (using an extra dependency I'm already using) so I'll report it there.

rromanchuk commented 4 years ago
== ap @summaries, html: true