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

github.com

When using the json gem, you might run into this error when using JSON.parse: >> json = 'foo'.to_json >> JSON.parse(json...

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...

makandra dev
aaronlasseigne.com

All Rubyists should be familiar with the common definitions for include and extend. You include a module to add instance...

developer.mozilla.org

Non-SSL contents on SSL pages are blocked by default Bug 834836 – Turn on pref to block mixed active content...

apidock.com

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

thejh.net

What you copy may not be what you see in the browser. Here is an online tool to determine the...

Note: This technique is confusing and slows down your test suite. Copy the attached code to features/support. This gets you...

Say you want to allow users to emphasize some string, but the whole markdown thing would be far too much...

stackoverflow.com

Usually, the logrotate service takes care of renaming log files each night or so to avoid logs becoming huge. That...

stackoverflow.com

TL;DR: Variables not declared using var are stored outside the current scope, most likely in the global scope (which...

stackoverflow.com

When you use ab to do some performance benchmarking, you might run into output like this: Complete requests: 200

Find out in this short guide, how to horizontally center a absolute positioned container with CSS. Note: We have a...

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...

The User-Agent HTTP header identifies the client and is sent by "regular" browsers, search engine crawlers, or other web...

Spreewald's patiently repeats the given block again and again until it either passes or times out.

makandra dev

Ever wondered about the difference between def and define_method? Turns out there are three implicit contexts in Ruby. def...

The way Rational#to_s works on Ruby has changed from Ruby 1.9 on. Here is how to get the...