I do a few development jobs on the side for friends. One such friend got in touch with me about a week ago wanting me to add a form emailer to his static html site (I developed it using Webby). My first thought was to set it up as a Rails app, but that seemed a little overkill for adding a single feature, especially when Webby gives me layouts for static pages and with Rails I'd have to put a solution for that together. Then I thought about using Widget Finger, but I really didn't want to push him to pay for it, especially not when I already had the site hosted on a virtual private server that we have for Hello Theory.
That's when it hit me. I could use Webby to generate an app that was mostly static, but that used Sinatra to handle the form emailer. Starting with my original Webby site, here's how I did it.First, I added a folder to the project's content folder named public, and moved all of the existing content files into that folder.mkdir content/public mv content/* content/public
Next, I added a new Rackup file (config.ru) to the content folder based on these directions.
require 'rubygems' require 'sinatra' root_dir = File.dirname(__FILE__) set :environment, ENV['RACK_ENV'].to_sym set :root, root_dir set :app_file, File.join(root_dir, 'simgins.rb') disable :run run Sinatra::Application
I set up my Sinatra script to send email using Pony and tested it. There's a great example of using Pony to send email with Sinatra in the Sinatra FAQ.
Finally, I deployed using Webby's deploy feature:webby deploy
The combination seems to be working like a charm, and keeps things way simpler for static page development than Rails would have. One small issue that I have is that I haven't come up with a good way to touch the tmp/restart.txt file to get Passenger to reload the app each time I deploy, but I've got a few ideas on that.
Personally I would like Microsoft to get more involved with HTML 5. They’ve sent very little feedback over the years, far less than the other browser vendors. Even when asking them about their opinion on features they are implementing I rarely get any feedback. It’s very sad.Ian Hickson
With that said, I really wish that there was a feed reader that would
prioritize my news a bit better for me. I would love to see my feeds
organized by online popularity (maybe based onumber of links to the
story) and by my favorite topics. Also, I would love a reader that
would group duplicate posts together and would follow stories back to
their source. That way I could go through and see most of the news
that I probably want to see and less of the stuff that I probably
don't care about.
respond_to do |format|
format.html { handle_html }
format.csv { handle_csv }
end
get :action, :format => :csv
:csv to "csv" fixed the problem:
get :action, :format => "csv"