Detecting if a Javascript is running under Selenium WebDriver is super-painful. It's much easier to detect the current...

makandra dev

Attached is a working config to deploy an application with Capistrano that needs to monitor Resque workers with God.

Hint: There's another card with this helper for Cucumber features. Sometimes you feel like you need to stub some...

tl;dr: Always have your attachment path start with :rails_root/storage/#{Rails.env}#{ENV['RAILS_TEST_NUMBER']}/. The directory where you...

makandra dev

When you need to create a locale for a language variant (like Austrian for German), you probably don't want...

makandra dev
github.com

When you need to use diff in either some Ruby code or your Rails app, use the differ gem.

codeodor.com

Code example for implementing Cross-Origin Resource Sharing (CORS) in Rails.

To offer files for download, use send_file. def download(file) send_file file.path, :disposition => 'attachment' end

Passenger gives you the possibility to define in which environment your app should be started. This has to be added...

Possible fixes: Upgrade your Firefox. It's fixed in 5.0. Hunt down funny float or overflow directives in your CSS...

The Javascript code below is a rough equivalent to the simple_format helper that ships with Rails: function simpleFormat(str...

Resque comes with its own dashboard (Resque server) that you can mount inside your Rails 3 application with #config/routes.rb:

Note: If you are currently working with Ruby 1.8.7 or 1.9.3, we recommend to upgrade to Ruby 2.1 first. From...

This note describes how to kick a user out of a Rails application after she hasn't requested an action...

When you create a temporary file (e.g. to store a generated Excel sheet) and try to send it to the...

In Rails 2, you could use link_to_remote...

...:update => 'id' to automatically replace the content of $('#id').

makandra dev
failtale.be

Free Hoptoad/Airbrake alternative which can capture exceptions from any platform. It comes with a Rails notifier and a RESTful API...

This finally works: User.any_instance.should_receive(...) as does User.any_instance.stub(...) Note: You won't have RSpec 2.6 if you're still working...

Note that this card is very old. You might want to use ActiveType for your auto-coerced virtual attributes instead...

github.com

Leads to awesomeness and unicorns when used in production.

API breakage ahoy. You need to either upgrade your Capybara or downgrade your selenium-webdriver gem. Alternatively, this could solve...

Note: Consider using MATE instead of Gnome 3 on newer system Awesome is a very good tiling window manager that...

robots.thoughtbot.com

We are changing our name from Hoptoad to Airbrake. You see, some folks much larger than us reached out and...

When you generate a URL in a mailer view, ActionMailer will raise an error unless you previously configured it which...