RubyFlow The Ruby and Rails community linklog


The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

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