RubyFlow The Ruby and Rails community linklog

How to include methods in the JSON representation of a model

Here’s a short blog post about using active_model_serializers, so you can all get rid of your as_json, to_json and serializable_hash monkey patches: https://christoph.luppri.ch/articles/2016/09/22/how-to-include-methods-in-the-json-representation-of-a-model/

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in