Most voted "active-model-serializers" questions
4 questions
Sort by count of
-
0
votes0
answers27
viewsHow to serialize an object generated by Factorygirl?
I have an object user generated by FactoryGirl like the below: FactoryGirl.define do factory :user do name { FFaker::NameBR.name } image { FFaker::Avatar.image } email { FFaker::Internet.email }…
-
0
votes1
answer35
viewsbelongs_to association inside serializer is not returning anything
The application contains a module called Dispute, this module contains Procedures, each Procedure contains a user and belongs to a dispute. As described below, belongs_to is not displayed and the…
-
0
votes2
answers315
viewsHow to render a json with the json_api adapter using Rails Serializer?
Oops, I’d like to render a json using the json_api standard (http://jsonapi.org/) using Rails Serializer(https://github.com/rails-api/active_model_serializers). In my controller I’m rendering…
-
0
votes2
answers226
viewsRendering a JSON object with the merging of different models
I am developing an API with Rails 5 and have the following models: class cotacao < ApplicationRecord belongs_to :usuario has_many :cotacao_itens, dependent: :destroy accepts_nested_attributes_for…