Sometimes the Rails helper #distance_of_time_in_words is using too much magic. When you need a time difference...
Consider this HTML: Even though the surrounding container defines a line-height, which vertically centers its inline elements, the check...
When the Ruby parser module of Ruby-GetText comes across a file in one of its search directories (e.g. lib/scripts...
Detecting if a Javascript is running under Selenium WebDriver is super-painful. It's much easier to detect the current...
Hint: There's another card with this helper for Cucumber features. Sometimes you feel like you need to stub some...
The Capybara API is somewhat hard for parse for a list of methods you can call on a Capybara node...
When your Cucumber feature needs to browse the page HTML, and you are not sure how to express your query...
When you need to use diff in either some Ruby code or your Rails app, use the differ gem.
Under the same origin policy, a web page served from server1.example.com cannot normally connect to or communicate with a server...
I think this pattern is really useful not just for upgrading suites from Webrat, but really anywhere you have an...
This is now part of geordi. Please don't follow the instructions below, if you use geordi. Inspired by the...
The Javascript code below is a rough equivalent to the simple_format helper that ships with Rails: function simpleFormat(str...
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...
In Rails 2, you could use link_to_remote...
...:update => 'id' to automatically replace the content of $('#id').
Note that this card is very old. You might want to use ActiveType for your auto-coerced virtual attributes instead...
We usually generate our commit messages from Pivotal Tracker IDs and titles, like [#15775609] Index view for conflicts
When you generate a URL in a mailer view, ActionMailer will raise an error unless you previously configured it which...
Here are some popular mistakes when using nested forms: You are using fields_for instead of form.fields_for.
When you render a nested form for a Movie which has_many :actors, you want to render the right number...
If you need Google Chrome to run in English, and your system locale is a non-English one, you have...
If you want to use a helper_method my_helper_method inside a model, you can write ApplicationController.helpers.my_helper...
This card explains how to upgrade an existing RubyMine installation to a newer version. If you're installing RubyMine for...
When rendering a number, you want to pretty up the string coming from #to_s: Render 0.0 as 0
I encountered a bug in RSpec 1.x where stubbed class methods ("static methods") would not be unstubbed before the...