Nick Sutterer
Nick Sutterer
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:...
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...
Of course, TRB is Ruby >= 2.1! :beers:
That's a cool idea! This should be pretty "straight-forward" by extending this: https://github.com/apotonick/roar/blob/master/lib/roar/hypermedia.rb#L59 The `options` hash is where you could specify the links to be in-/excluded.
I recommend using a domain object (e.g. OpenStruct) that reflects your concern and pass that into the representer. I keep repeating myself, but forms, cells, and representers are no data-mappers,...
BTW, if you want `neighbourhoods` to be called on the decorator, you can do ``` ruby collection :neighbourhoods, exec_context: :decorator, .. ``` But this still won't give you access to...
Nick, hey! Your "problem" is you want to render a full-blown document and not just a collection. This is why you should think "in that document" and not in collections!...
This is because `render` + `:represent_with` doesn't work! Rails uses it's built-in `#to_json` and that is wrong, of course. Let me check out how `render` works in that context. BTW...
Right now, this needs to be supported on the model layer. ``` ruby category.category_id #=> 1 ``` You could pass the product model into the `to_json` call and then use...
The `link` is omitted because you're using a "lonely collection", which solely consists of items in a collection. The whole point of a lonely collection is that there's no other...