Search code examples
ruby-on-railsapiversioningapi-versioning

Rails API versioning


I am trying to implement api versioning the Railscasts #350 way (no gem). Is there a way to create only updated resources in new version and not entire set of controllers and views(jbuilder) with fallback to latest supporting version functionality? I am using the accept header with "scope model:" without namespaces. Thank you.


Solution

  • You should not version only part of a resource e.g. create. What will happen is you'll have dependencies created and your views and controllers only know 1 version of the resource. This can lead into problems in the future. You should do a default version if non is provided.

    Best practices for API versioning?