Thursday, 15 January 2015

Specifying multiple (active model) serializers in a larger, grouped JSON response in Rails? -


Text after "div class =" itemprop = "text">

I have a bigger size JSON response in a controller method:

  json render: {User: {id: @ current_user.id, name: @ current_user.full_name, title: @ current_user.title, phone_work: @ current_user.phone_work, phone_mobile: @ current_user.phone_mobile, address: @ current_user.addresses}, appointments: @ Current_user .appointments} I tried to do  AppointmentSerializer.new (@ current_user.appointments)  and I found this error:  Undefined method 'read_attribute_for_serialization' . The error is coming from the first line, where json has been rendered. ( render json: ) 

I can specify different serializers for the user's address, and for the placements?

"itemprop =" text ">

There is an important issue to answer your question, which version of AIIMS are using?

As a contributor to AMS, I firmly advise you to keep it and see, we are actively working on new version 0.10.0 (which can be 1.0) , It is believed to release next month so keep in mind that you can update it soon and avoid some old issues.

Regarding your question, I think you have forgotten to include the serialization module in your model. Just add it and you can be fine.

ActiveModel :: Ordering Include

You can see the year 0.9 version in the context of this


No comments:

Post a Comment