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.
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!
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