We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A model that has image_versions might want to have a link for image item in the field. Like so:
image_versions
{ "id" : 123, "image_versions" : ["small", "large"], "_links" : { "image:small" : { "href" : "http://example.org/images/123/small.jpg" }, "image:large" : { "href" : "http://example.org/images/123/large.jpg" } } }
we can override https://github.com/apotonick/roar/blob/master/lib/roar/hypermedia.rb#L54, but maybe we want a better DSL? How about something that is evaluated on an instance before representing it?
before_represent do represented.image_versions each do |image_version| link image_version do "http://example.com/images/#{represented.id}/#{image_version}.jpg" end end end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
A model that has
image_versions
might want to have a link for image item in the field. Like so:we can override https://github.com/apotonick/roar/blob/master/lib/roar/hypermedia.rb#L54, but maybe we want a better DSL? How about something that is evaluated on an instance before representing it?
The text was updated successfully, but these errors were encountered: