Caution when using .where to exclude records from a scope like this: # Fragile - avoid User.where("id NOT IN (?)", excluded_ids...
In specs, the session never persists but is always a new object for each request. Data put into the session...
Find out in this short guide, how to horizontally center a absolute positioned container with CSS. Note: We have a...
view_context.helper_method('args') Rails 2 ApplicationController.helpers.helper_method('args') Also see How to use helper methods inside a model...
The way Rational#to_s works on Ruby has changed from Ruby 1.9 on. Here is how to get the...
Unfortunately, Capybara does not offer a switch to disable cookies in your test browser. However, you can work around that...
Rails flashes (FlashHash) track a list of used keys, which is not respected when comparing flash hashes.
Rails understands a :limit options when you create columns in a migration. Its meaning depends on the column type, and...
Sometimes it seems a favicon does not work because your browser displays an old version or (in case of local...
calc() lets you mix CSS units. Ever wanted to give an element "the container's width minus 20px on each...
tl;dr: Do not use merge! for session hashes. Use update instead. Outline Let's assume you're modifying the...
Don't Google this, you will lose all will to live. Instead use Object#isEqual() from Lodash or Underscore.js:
MongoMapper is a MongoDB adapter for Ruby. We've forked it so it works for Rails 2.3.x applications running...
If you need to capture signatures on an IPad or similar device, you can use Thomas J Bradley's excellent...
If you have an integer and want to use it to represent an element's position (like "1st" for 1...
validates_uniqueness_of is not sufficient to ensure the uniqueness of a value. The reason for this is that in...
Calling bundle update GEMNAME will update a lot more gems than you think. E.g. when you do this...
Awesome color schemes for RubyMine, Sublime Text 2 and other editors. To install the themes into your Rubymine, copy intellij...
The way MySQL's FULLTEXT tokenizer splits text into word tokens might not always be what you need. E.g. it...
li.active a:link Example output (specificity): | 0 | 2 | 2 | See also: https://www.codecaptain.io/tools/css-specificity-calculator
While you are probably using will_paginate to paginate ActiveRecord scopes, it can actually paginate plain Ruby arrays. The resulting...
When doing a git blame, git will blame the person who added or removed white space in a line (e.g...
Our old solution for cronjobs, the "craken" plugin, is no longer maintained and does not work on Rails 3.2+.
You know that you can force absolute URLs throughout a response. Now you want to modify URLs similarly, but only...