When building HTTP API with Rails 3.2, should I disable front end things such as .js files?

StackOverflow https://stackoverflow.com/questions/9339266

  •  27-10-2019
  •  | 
  •  

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?

有帮助吗?

解决方案

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top