(Ruby 2.3.1, Rails 5.0.0.1)
I've already implemented an API versioning in the URI and added devise token auth like this:
constraints subdomain: 'api' do
scope module: 'api' do
namespace :v1 do
# V1 stuff
resources :users
mount_devise_token_auth_for 'User', at: 'auth'
end
end
end
The result of 'rake routes' (example row) therefore is:
v1_user GET /v1/users/:id(.:format) api/v1/users#show {:subdomain=>"api"}
Now in my controller, any helper related to the user contains the "v1" versioning. E.g.:
before_action :authenticate_v1_user!
I'm new to this concept, but should this not be avoided? If I'll ever upgrade to a v2, I'd have to go through all those helpers and make sure I'll change it to prevent it from breaking? Or how would the upgrade process look like?
Thanks for your feedback! This might be a very easy question, but I'm a bit confused.