Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...

We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...

You can detect city and country from an IP address by using the GeoLite database. This is a flat file...

When you download or upgrade RVM it has a hardcoded notion which patch level it considers to be "1.9.3".

tl;dr: Ruby's Bundler environment is passed on to system calls, which may not be what you may want...

Rails gives you migrations to change your database schema with simple commands like add_column or update. Unfortunately these commands...

Caution when using .where to exclude records from a scope like this: # Fragile - avoid User.where("id NOT IN (?)", excluded_ids...

This only works when you actually have a session ID (not the case for Rails' CookieStore, for example): request.session_options...

In specs, the session never persists but is always a new object for each request. Data put into the session...

apidock.com

All columns of a model's database table are automagically available through accessors on the Active Record object.

Rails has generic error messages you can define in your locale .yml files. You may override those application-wide error...

blog.codeclimate.com

Rails’ reputation as a relatively secure Web framework is well deserved. Out-of-the-box, there is protection against many...

nt.ntnu.no

yaml4r is a juxtaposition of yaml documents and their Ruby couterpart. Thus, it does a great job as YAML-doc...

Sometimes you might want to limit the number of associated records in a has_many association, but cannot add 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...

When a controller action redirects to an external URL (like http://somehost.com/some/path) you will find that this is hard...

Unfortunately, Capybara does not offer a switch to disable cookies in your test browser. However, you can work around that...

stackoverflow.com

Access the Method object Dead simple: Get the method object and ask for its owner: "foo".method(:upcase) # => #

Rails flashes (FlashHash) track a list of used keys, which is not respected when comparing flash hashes.

Do not pass times to date attributes. Always convert times to dates when your application uses time zones. Background

Ruby 1.8 (supplied by Rails' ActiveSupport) >> BigDecimal.new("0.1").floor.class => BigDecimal Ruby 1.9 (supplied by Ruby 1.9 itself) >> BigDecimal.new("0.1").floor.class...

ariejan.net

Rails understands a :limit options when you create columns in a migration. Its meaning depends on the column type, and...

robots.thoughtbot.com

Guide how to make fixes in other people's GitHub repositories. It's basically "Open Source Development 101".