We are planning to supporting a ruby 1.9.x application (which has database connectivity via ActiveRecord, but no user interface). We used rails (3.1.3) generate command to generate the application template files, but we wouldn't need access to view specific files. What command should I use to generate only the files which would be needed REST services which will be exposed via an ActiveResource
Asked
Active
Viewed 562 times
1 Answers
0
- I think this answer sheds some light on it: Using ActiveResource without Rails
- And this article seems to describe a project that exposes a RESTful API, without an interface http://www.therailsway.com/2007/9/3/using-activeresource-to-consume-web-services/
You could also just straight up delete the view files, and in your controllers, avoid rendering any of the templates. Rails will, by default, will try to find a template with a name matching the action, but you can tell your actions not to render anything.
The other option is to not write it as a web app, but instead as a Rack app, or just pure Ruby, if you don't need an interface. Rails is really built to create interactive web apps, so maybe everything that comes with Rails by default is really more than you need?