-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
I suppose there is an example that is wrong about hanami framework.
the file is located at source/guides/serialization/rendering.html.md.
The example says:
module API::Controllers::Posts
include API::Action
include JSONAPI::Hanami::Action
expose :url_helpers
class Create
# ...
@url_helpers = routes # Will be available inside serializable resources.
self.data = posts
self.include = [:author, comments: [:author]]
self.fields = { users: [:name, :email],
posts: [:title, :content] }
end
end
It should be like this:
module API::Controllers::Posts
class Create
include API::Action
include JSONAPI::Hanami::Action
expose :url_helpers
def call(params)
#...
@url_helpers = routes # Will be available inside serializable resources.
self.data = posts
self.include = [:author, comments: [:author]]
self.fields = { users: [:name, :email],
posts: [:title, :content] }
end
end
end
Metadata
Metadata
Assignees
Labels
No labels