Makandra cards will auto-detect the language used for syntax highlighting. This auto-detection sometimes fails for short code snippets...

stackoverflow.com

When you use method_missing to have an object return something on a method call, always make sure you also...

When refactoring a sequence of steps to a new, more descriptive step, you can use the steps method and Ruby...

In Rails 3.1+, instead of defining a separate up and down method you can define a single method change:

makandracards.com

Updated the card with our current best practice (shared app code and specs via symlinks).

Sometimes you need to remove high Unicode characters from a string, so all characters have a code point between 0...

makandra dev
robots.thoughtbot.com

The Rails community has been abuzz with object-oriented programming, SOLID principles, laws, design patterns, and other principles, practices, and...

seejohncode.com

This sounds promising: The best part from the Rails side, is that you don’t have to change anything at...

blog.avisi.nl

On case-insensitive file systems like Mac's HFS+ (per default – you may change this, but it won't work...

If you're suffering from a huge de.yml or similiar file, cry no more. Rails lets you freely organize your...

If you upgrade to the mysql2 gem, you will run into the problem that the server's database.yml (which is...

makandra dev

Last week saw a security issue with rails 2.3 that required a fix. While an official patch was provided, the...

In large forms (30+ controls) new Capybara version become [extremely slow] when filling out fields. It takes several seconds per...

This script loads a dump into your development database. You can provide the full path to you database dump like...

When using the asset pipeline your assets (images, javascripts, stylesheets, fonts) live in folders inside app: app/assets/fonts app/assets/images...

makandracards.com

deploy-to-production now calls Capistrano with bundle exec since we started to bundle Capistrano in all projects.

The following code activates autoloading using ActiveSupport 3.x: require 'active_support' require 'active_support/dependencies' relative_load_paths = %w[app/controllers...

Probably was in the repository once and got deleted in a commit that you pulled.

Localizing a non-trivial application can be a huge undertaking. This card will give you an overview over the many...

If your project uses another version than your default Ruby, RubyMine will give you incorrect inspections, for example.\

makandra dev

Capistrano recently had some API changes that can results in deploys not working when running with old deploy.rb files.

stackoverflow.com

%p #{link_to "label", "url"}! Haml is a great engine for writing shorter, readable HTML. However, there is...

When requests arrive at the application servers simultaneously, weird things can happen. Sometimes, this can also happen if a user...

stackoverflow.com

Using beginning_of_day or end_of_day on Date or DateTime objects in Rails 2.x applications will never...