Open doughsay opened 9 years ago
Haha, I had to look up my own API and see how :skip_render
is interpreted! :blush:
The :skip_render
option is run "per item" and I think that is the problem: while the items are left out, the original collection "wrapper" is still rendered. Can you verify that without HAL, please? (In a test, ideally?)?
Awesome news: In awesome Representable 2.4, which is gonna be awesome, we have a pipelined architecture per property. That means, you can set up a pipeline for, say, a collection and say "run :skip_render
, for every item, but also after that for the entire property". It's so awesome.
collection :songs, render_pipeline: [Get, SkipNil, Iterate[SkipRender], SkipRender, Write]
That DOES sound awesome. Can't wait! :+1:
Hi there, sorry to keep bothering you about these HAL rendering issues! On the latest 1.0.3 I'm still having the following issue:
As you can see from the above contrived example, the
skip_render
option only empties out the related collection, but still renders an empty array in its place. In addition to that, therender_empty
option won't help in this scenario either, although it does work when the collection is legitimately empty.Hope this helps!