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
In Chapter 6 - section Serialize Products. We use a generator like so:
rails generate serializer Product title price published
This automatically adds the attributes. However, in the text you are encouraged to add the, already created, attributes. As follows:
$ rails generate serializer Product title price published create app/serializers/product_serializer.rb
Now let’s add attributes to serialize the product: Now check the generated product serializer:
Listing 75. app/serializers/product_serializer.rb class ProductSerializer include JSONAPI::Serializer attributes :title, :price, :published end
There you go. It’s no more complicated than that. Everything looks right. Let’s change our controller a little bit.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In Chapter 6 - section Serialize Products. We use a generator like so:
rails generate serializer Product title price published
This automatically adds the attributes. However, in the text you are encouraged to add the, already created, attributes. As follows:
Suggested changes
Now let’s add attributes to serialize the product:Now check the generated product serializer:
There you go. It’s no more complicated than that.Everything looks right. Let’s change our controller a little bit.The text was updated successfully, but these errors were encountered: