Openhood

Openhood Experiments

Let's share our tech experiments and discoveries.
By Openhood

Link to static assets on Rails 3.1

Having just migrated an application to Rails 3.1, we discovered that the following line is not valid anymore:

Read more

Read more
By Openhood

Add routes at runtime on Rails 3

Sometimes you just want to take the forbidden path. We had the case quite recently, while testing a Paypal integration. We did want to add a route to a fake Paypal service with a link back to our website after succesful payment, but at the same time we didn’t want to polute our routes.rb just for test purpose. Hopefully, it’s still possible to add routes at runtime even on Rails 3. The issue is calling Rails::Application.routes.draw clears all existing routes and after that no further route can be defined. The solution is inspired by how Rails is doing route reloading:

Read more

Read more
By Openhood

Rack::Test warning on Ruby 1.9.x

If you’ve tried to use Rack::Test on Ruby 1.9.x, which is the default when using capybara for exemple, you’ve probably been bugged by nasty warning like this one:

Read more

Read more
Copyright © 2025 Openhood SARL