I'm looking to code a rails app that will only display an index page. It will not use any database access. All functionality will be implemented using one controller and javascript. What's the minimum number of files and directory structure needed for an app like this?
Asked
Active
Viewed 505 times
1 Answers
5
If that is all you want, why Rails?
Rails is a very complex framework that gives you a bunch of functionality at your fingertips. But if you specifically say you won't be using any of it (only one controller, so no routes to worry about, no database, so no models either, only one page, so layouts are meaningless...), why not just write a Sinatra app?
With Sinatra, you can write everything in one Ruby file. If you really want to, you can even pack all the templates in it, but that's overdoing it a bit. Thus, I'd say, 1 .rb
, 1 or more templates (if you use partials), 1 .js
and 1 .css
.

Amadan
- 191,408
- 23
- 240
- 301
-
1Thanks! I always heard about Sinatra, but never looked into it. Looks like exactly the solution I need. I lied and realized I need database access now, but only one table, so I guess I'll be [using this!](http://stackoverflow.com/questions/777724/whats-the-best-way-to-talk-to-a-database-while-using-sinatra). – user449511 Apr 26 '11 at 09:06
-
Sinatra is awesome and I agree. However there is a use-case for a minimal Rails app, and that's testing a Rails plugin gem. – gtd Oct 25 '11 at 22:08