When building HTTP API with Rails 3.2, should I disable front end things such as .js files?
-
27-10-2019 - |
Question
When building HTTP API which respond only JSON format with Rails 3.2, should I turn off things like Asset Pipeline and javascript files?
If so, how to do it correctly instead of manually deleting which sounds dirty?
Solution
Probably a good idea if you're only serving up the api, here's how:
rails new appname --skip-sprockets
For an existing application, in your application.rb:
config.assets.enabled = false
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow