Recently one of my sites underwent a major overhaul. One addition was the ability to subscribe and unsubscribe to a mailing list.
The typical process usually involved either a mailto link or simple form. Sort of like the Feedburner integration on my blog.
I couldn’t help think, why not use that new magic Web-dot-O (Web 2.0, Ajax) goodness to make things a tad easier for visitors. Less jarring.
After contemplating copying the various javascripts, whipping up a typical perl, php or ruby script to handle everything I realized, Rails has it all.
Actually, Rails is perfectly designed for this task!
Quickly, I created a new Rails application, copied the static site into the public directory and fired up the Rails server. Pleasantly the site appeared as I expected.
After I wrote the controller, views and mailer, sprinkled the Rails javascripts as need in the static html files, everything was ready to go.
So, why not keep the two completely separate?
You can’t submit Ajax calls that are not on the same domain. Web browser security precautions stop the requests. You can make them till you’re blue. Nothing comes back. There are hacks using Apache proxy passthroughs.
Why bother. Rails is so elegantly designed it makes an excellent wrapper for static sites that need a few bells and whistles.
My next step is to create a few more commonly needed functions for static sites.
Maybe I will call this technique Railings? LOL.

0 responses so far ↓
There are no comments yet... Kick things off by filling out the form below.
Leave a Comment