Simple websites (no DB?) with Rails??

I have been learning Rails and building small things over the last several months. Question I have that has been surprising difficult to figure out is this (I know it seems somewhat nonsensical but ignore that). I recently started getting a few requests for basic website to be built, small businesses, stores, even individual people. How would one about doing such a thing using Rails? I may not even have a database in some of these, or if I do, probably just one. More or lass we are talking about 3-5 page static sites. I have built much more complex things over the course of my learning, but have not used rails for this yet. What is the proper way to go about such a thing in rails? I suppose I could create a separate controller and view(s) for each page, make the RHTML look real nice and link them all (links_to). (some of these may or may not be a little dynamic) The reason I ask::: I am fully aware that there are much easier ways to simply build a website and be done with it, such as 'homesite', or 'frontpage'. I ask for two reasons: 1. I like Rails and prefer to keep using the same process of development (especially when i am new) for all projects no matter how small. AND 2. I know that often these types of projects start out one way and then end up entirely different. Right now they say I just need a 3 page static website but 3 months from now they want a content management piece built in or a shopping cart and commerce page.... I can only assume that if I started the project as a Rails project from the start, no matter how small and insignificant - it would make things much easier when I start adding to it and making it a full blown APP? Anyone agree, disagree, have done this?


I completely disagree with you.

You are going way overkill to build a really small website. Plus even if the site grows to have an e-commerce website you are going to have to start over anyways because the scope of the project has changed so much that it would be impractical to simply add to a 3 page website. Rails is not meant to be used for static sites but web applications. If you aren't building a web application then Rails is not the tool for you. It would be like trying to use a screwdriver when you need a wrench. Not to mention you will save money on hosting, save time, headaches in updates, and your site will have better performance and more...

I can crank out a 3 page static site in a few hours and have it launched in 2 minutes. If I were to use rails for the same 3 page static site it would take me way longer then that just to setup a subversion repository, capistrano, a productions server, not to mention forcing a model view controller design pattern on a simple website. Save yourself a headache. The MVC design pattern comes from software what's the point if you can't utilize it??


well, point taken, and clearly you are correct in what you say. I wanted to throw that out there to see how others were using it for the everyday stuff. I will crank up homesite and use CSS/HTML for the website. Thanks for the opinion.

Again, it's likely to be overkill, but if you expect that the content is going to grow but remain "largely static content", you may want to consider using a Content Management System (CMS) such as Radiant. Yes, it won't be up and running in 3 hours, but it would give you the flexibility of managing updates, etc. quite easily.

Hope this helps.

Cheers, Mohit. 9/8/2007 | 12:11 PM.

jas wrote:

that does help. Radiant is really a static site creation tool and CMS isnt it? Are there any others based on ROR or Ruby?

Thank for the help.

I think there are a few - someone had recently posted links to a few other systems a few days back. I find that Radiant is quite easy to use though you need to spend some time with it (a few days) to get it right. But, it handles content as Pages. Pages have of a Layout. Layouts and pages can reuse Snippets.

It's not really a static site creation tool since dynamic content can be handled quite easily but in my mind, it's the most logical replacement for a static site.

Hope this helps.

Cheers, Mohit. 9/18/2007 | 10:47 AM.

agilehack wrote: