문제

How do I get AwesomePrint.ap to show the associated objects that are nested inside an object? It doesn't do this by default and I'm assuming there's a way to force it?

도움이 되었습니까?

해결책

You can use the raw parameter, e.g.

ap my_model, raw: true

This recursively formats instance variables. You can also make it the default using AwesomePrint.defaults (Documentation)

But beware: That feature can add a large amount of noise, especially when printing Rails related object instances. (especially ActiveRecord::Base)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top