ActiveRecord models know how to cast a given string to the type of a given attribute (or column).
Reading a URL via GET: curl http://example.com/ Defining any HTTP method (like POST or PUT): curl http://example.com/users/1...
User.active.to_sql Rails 2 Use either the Edge Rider or fake_arel gem to get #to_sql backported...
The Basic Authentication header encodes username and password. Effectively, it's just Base64 plus a "Basic" prefix.
It is common in Rails 3.0 applications that you want to provide default views for a group of controllers. Let...
One of the thornier problems in our workflow is knowing when assets are delivered from the designer and keeping them...
When installing RMagick you may get an error messages like this: Version 2.13.1: checking for Ruby version >= 1.8.5... yes
By default, Opera 11 hides any passed params and the URL's protocol until you focus the address bar.
If you want to manually check if e-mail delivery works on a machine by sending an e-mail you...
Note: ActiveRecord::Base#becomes has a lot of quirks and inconsistent behavior. You probably want to use ActiveType.cast instead.
Artifice allows you to replace the Net::HTTP subsystem of Ruby with an equivalent that routes all requests to a...
mitmproxy is an SSL-capable, intercepting HTTP proxy. It provides a console interface that allows traffic flows to be inspected...
There is a nasty bug in all version of Rails 2 and some versions of Rails 3.x where two...
If there is some weird margin at the top of your page for no apparent reason, chances are one of...
Within an event handler, there are multiple methods to cancel event propagation, each with different semantics. event.preventDefault() Only prevents the...
Google’s Font Directory and API for web fonts could have a transformative effect on how we read the web...
If you're using jQuery, you need to update to 1.5.1 to get Internet Explorer 9 to work.
When you write a custom RSpec matcher a good place to store them is to create one file per matcher...
To test whether a hash includes an expected sub-hash: expect(user.attributes).to match(hash_including('name' => 'Bruce Wayne'))
At times, it might be unavoidable to have different CSS rules for Internet Explorer than for sane browsers. Using Sass...
Back when Steak was first released, Capybara didn’t have any of the nice RSpec helpers it does now. A...
The information in this card is only relevant for Rails 2.3-era apps. This note gives a quick introduction into...
Liquid Canvas is a JavaScript library which allows you to draw inside an HTML canvas element with an easy yet...
If you just upgraded to Bundler 10.0.10 you might get the following error when bringing up Rails: /usr/lib/ruby/1.9.1/psych.rb:148:in...