trailblazer / roar-jsonapi

JSON API support for Roar.
http://trailblazer.to/gems/roar/jsonapi.html
MIT License
42 stars 18 forks source link

passing meta option does not work for JSONAPI #4

Closed myabc closed 7 years ago

myabc commented 7 years ago

From @desheikh on July 21, 2016 19:18

Calling to_hash on a representer with ("meta" => {"foo" => "bar"}} does not render the meta attributes.

It looks like the implementation partially exists but is missing actually making the call and returning the response: https://github.com/apotonick/roar/blob/master/lib/roar/json/json_api.rb#L166

Copied from original issue: trailblazer/roar#196

myabc commented 7 years ago

From @KonstantinKo on August 29, 2016 7:43

I second this request. The README mentioned, that parsing meta is not yet implemented. But it appears that rendering meta information doesn't work either. When just giving a meta key in the options it just gets ignored like @desheikh said.

When I insert a meta do block into the test representer, I get the error undefined local variable or method 'format_engine' for #<Class:…

Yes, this is definitely needed. For example for rendering a collection with pagination - similar to your blog post, @apotonick.

Please add this feature :heart:

myabc commented 7 years ago

@desheikh @KonstantinKo would be grateful for feedback on fix (#1).