Skip to main content

Posts

Showing posts from July, 2010

Rails3, Rack and "Where did my Metal go?"

Our Rails3 (beta4) application had one route mapped in config/routes to a Sinatra app, by means of the following route: match '/foo', :to => EndPointApp, :as => :endpoint The route was being defined to run as a Sinatra Application require 'sinatra' class EndPointApp < Sinatra::Application post '/foo' do ... end end This was working mostly fine, but it was returning Set-Cookie header with the standard Rails sessions cookie, which in this case was preventing the client of this endpoint from successfully interpreting the result. As I could do nothing about the client side, I had to remove Set-Cookie from the headers, but only for this end-point and obviously not from the entire app. This proved to be somewhat more complicated than I had hoped, so let me share the solution here in hopes it might save someone else an hour or two. First, I ran "rake middleware" and observed the following Rack stack: use ActionDispatch::Static use Rack::Lo

Rails3 and The Inevitable Fragmentation

I remember one of the early talks at the Canada On Rails in 2006 had a slide showing how many books one needs to read to be able to write web applications in Rails, versus Java. Of course Java side had about 10 books: Java SE, Java EE, Hibernate, Struts/Tiles/JSF, WebServices, Ant, Maven, Eclipse, JUnit, etc, etc. The Rails slide proudly showed the now hopelessly outdated "Agile Web Development With Ruby on Rails", 1st edition. Those were the times. Back then, during my work for Blurb.com myself and three other engineers managed to learn ruby, rails and build a fully functional e-commerce site in about 3 months. I was blown away by the productivity gains compared to Java, where months could be spent laying out the project, and creating all necessary infrastructure for builds, deployment, automated testing with or without the database, etc. Fast-forward to 2010. We are on a brink of Rails3 release, and oh boy, has the landscape changed since back then. I would argue