File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -169,8 +169,8 @@ run Rack::Cascade.new [API, Web]
169
169
Place API files into ` app/api ` and modify ` application.rb ` .
170
170
171
171
``` ruby
172
- config.paths.add " app/ api" , glob: " **/ *.rb"
173
- config.autoload_paths += Dir [" #{ Rails .root} / app/ api/* " ]
172
+ config.paths.add File .join( ' app' , ' api' ) , glob: File .join( ' ** ' , ' *.rb' )
173
+ config.autoload_paths += Dir [Rails .root.join( ' app' , ' api' , ' * ' ) ]
174
174
```
175
175
176
176
Modify ` config/routes ` :
@@ -1560,7 +1560,7 @@ Create `config/initializers/reload_api.rb`.
1560
1560
if Rails .env.development?
1561
1561
ActiveSupport ::Dependencies .explicitly_unloadable_constants << " Twitter::API"
1562
1562
1563
- api_files = Dir [" #{ Rails .root} / app/ api/**/ *.rb" ]
1563
+ api_files = Dir [Rails .root.join( ' app' , ' api' , ' ** ' , ' *.rb' ) ]
1564
1564
api_reloader = ActiveSupport ::FileUpdateChecker .new (api_files) do
1565
1565
Rails .application.reload_routes!
1566
1566
end
You can’t perform that action at this time.
0 commit comments