This works in all relevant browsers: document.activeElement You can use this in your Selenium steps, for example, to assert that...
When searching for text in a MySQL table, you have two choices: The LIKE operator FULLTEXT indexes (which currently only...
Basic error pages To add a few basic styles to the default error pages in Rails, just edit the default...
If - for whatever reason - you have to render stylesheets dynamically, the following snippet might be of help. It emulates what...
Git commits should be very deliberate, and only contain changes that you really want to be in there. In order...
You know that you can force absolute URLs throughout a response. Now you want to modify URLs similarly, but only...
As the title says: this jQuery plugin creates bar charts from HTML tables. It comes in some different flavors.
The classical scenario: There's a parent div element and you want to center some arbitrary child element vertically inside...
Icon fonts like Font Awesome are infinitely scalable, look great on high-DPI displays and will give your app a...
Under certain (unknown) circumstances, Rails will give localized files an invalid content-type in the Response header. For me, after...
If you're using the Capybara webdriver, steps sometimes fail because the browser hasn't finished loading the next page...
Haml 3.1.2 displays single quotes in FormBuilder#text_ field html escaped. You may see something like that:
If your application has forms to edit string fields, you probably want to strip the entered values (remove whitespace from...
Randy Hoyt is presenting a way to display something (e.g. products) in a grid. It's responsive, too!
simple_format ignores Rails' XSS protection. Even when called with an unsafe string, HTML characters will not be escaped or...
Ever wanted autocompletion for paths from paths.rb in Cucumber? This card lets you write your steps like this:
StaticMatic is a nice tool to build simple static websites. In case you want to have some nifty styles on...
Note: Modern Rails has two build pipelines, the asset pipeline (or "Sprockets") and Webpacker. The principles below apply for both...
The step definition below allows you to write: Then I should see an HTML redirect to "http://www.makandracards.com" in the...
Under certain circumstances gettext_i18n_rails will hit a near-infinite loop. This occured in Rails 2.3.5 with Haml 3.0.18...
pjax loads HTML from your server into the current page without a full reload. It's ajax with real permalinks...
In a nutshell: return statements inside blocks cause a method's return value to change. This is by design (and...
A print stylesheet is easy to create. Choose a font suited for paper, hide some elements, done. Unfortunately print stylesheets...
Nice list of icon sets that come in the form of fonts. I recommend Font Awesome.