RubyFlow The Ruby and Rails community linklog

Rails API Pattern for Complex Collections

One of the patterns I’ve been using when building restful APIs is creating a model for collections. This model then uses a factory method for instantiating from a set of params. I’ve found this cleans up controllers significantly and creates a nice place for tests to hang off of. I’ve written a blog post about this building complex collections from params pattern.

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