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!

Simple API Versioning in Rails

There’s a way to build versioned web services using only core features of Rails, and it’s much simpler than you might think.

Comments

I don’t know, this way of doing it doesn’t seem very flexible. You can do the following and then parse the version param in a filter, as a more flexible way of doing it:

map.resources :items, :as => ‘items/:version’, :requirements => {:version => /\d+/}

Something I wrote a while ago uses a similar approach.

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