Reputation: 32170
All setups I've found use the following folder structure
/app
/controllers
/api
/v1
/views
/api
/v1
/models
This is ok, I guess. But I am trying to get a structure that looks like
/app
/api
/v1
/controllers
/views
/v2
/controllers
/views
/controllers #for non api stuff
/views #for non api stuff
at the moment, my routes for the api are set as
scope module: :api, defaults: { format: 'json' } do
namespace :v1 do
..
end
end
with controllers like Api::V1::MyController < ApplicationController
Is there a way to have this kind of structure?
Upvotes: 2
Views: 1210