Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
303 views

In Active Model Serializers.. Let's say I have CompanySerializer and EmployeeSerializer. On CompanySerializer I have a field ceo where I want to render the association with EmployeeSerializer but ...
Ben G's user avatar
  • 26.9k
0 votes
0 answers
67 views

I am working on a POC for switching from active-model-serializer to jbuilder. I am very sad to see AMS being relegated to unsupported status. It's going to take forever to convert our 200+ serializers ...
Dan's user avatar
  • 1,289
0 votes
1 answer
266 views

I'm trying to render an xml response on my rails API using mime response. the code is like this : respond_to do |format| format.xml { render xml: @records.to_xml, status: :ok } format.json { render ...
Yummy Tea Senpai's user avatar
0 votes
1 answer
81 views

I have the following ActiveRecord associations in Ruby on Rails: class Driver has_one :car delegate :tires, to: :car end class Car belongs_to :driver has_many :tires end class Tire ...
Starscream512's user avatar
0 votes
1 answer
95 views

I am learning rails, and using active_model_serializers gem. I need to get the customized output in JSON from two different tables. Here is an example car: id, name, color, size, shape, date... ...
SS Sid's user avatar
  • 457
1 vote
1 answer
245 views

I'm going to create API with Django Rest Framework for an existing Django project. I would like to use models of existing app (product/models.py) in 'API/models.py'. Will that work smoothly as of ...
madhu mitha's user avatar
0 votes
1 answer
234 views

I have the following models and serializers. I want a situation that when I make a request to my List Controller index, I get Expected Json. Please see below: # GET /lists def index @lists = ...
Bobb-wiz's user avatar
0 votes
1 answer
121 views

lets say I have a method as follows def index applications = Application.all render json: applications, each_serializer: ApplicationIndexSerializer, ...
haaaaa199's user avatar
1 vote
1 answer
125 views

I am trying to send one post to a create in a controller and create two objects. For some reason the contoller only will create a company. I did a similair thing in sinatra and it worked. I know that ...
Enzo007's user avatar
  • 11
0 votes
1 answer
60 views

My target is how to make ImageField() as optional in case user does not want to submit an image. When I use django Forms, then the ImageField() will work fine where the field will be treated as ...
Ray Ma's user avatar
  • 19
0 votes
1 answer
281 views

I have a Kit model with it's serializer: class KitSerializer < ActiveModel::Serializer attributes :id, :name, :description has_many :products, only: [:id, :price] end I need to use this ...
Gibson's user avatar
  • 2,075
0 votes
1 answer
848 views

I have an Rails 7 API and i'm using gem 'active_model_serializers', '~> 0.10.0' to make het fit in the json_api requirements, but i need to in the nested attributes of my items include the name, ...
VQV03's user avatar
  • 43
0 votes
1 answer
39 views

I want to render a part of embed model's fields . I wrote bellow code. But, I got a response include all embed model's fields. class RacesController < ApplicationController def index render ...
masaru.terada's user avatar
1 vote
2 answers
262 views

I am trying to find out why my update method is not working in my Rails API. It should update the bio field. I have my API hosted on Heroku and am using the Heroku logs to debug in production. I used ...
Zio-4's user avatar
  • 269
1 vote
2 answers
2k views

In ReviewsController serializers are used to display json. Like here: render json: @reviews, each_serializer: ReviewSerializer, root: false The serializer uses the following attribute :image. Like ...
Senonik's user avatar
  • 31

15 30 50 per page
1
2 3 4 5
49