Skip to content

Using serializers outside of ActionController  #1036

Closed
@yjukaku

Description

@yjukaku
  1. It would be awesome if the docs could be updated to show how to use AMS outside of a controller. If you want to do some checking in the console, it's not clear how to view serializer output. I believe it comes down to creating the eg. ArticleSerializer object and passing it to an ie. FlatternJsonAdapter but I can never remember how to do it - and I can't quickly find it even now.

  2. Is there a way to get the default serializer for a class, like how render json: @article automatically knows how to get the ArticleSerializer? I tried looking through the source for AMS but got lost. It seems the get_serializer method might be the key but it seems to only be able to be called from within a controller.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions