1

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?

Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244

1 Answers1

0

I think better way is to extract your api to gem.

djsmentya
  • 315
  • 1
  • 12