Never ever declare your associations with a string, especially when doing metaprogramming. A common mistake is something like # WRONG

If this happens to you: user.avatar = Avatar.new user.avatar # => nil (where avatar is a belongs_to), you probably declared your association...

makandra dev

This describes how to migrate an existing cucumber test suite to Spreewald. Add the gem Include spreewald into your cucumber...

Cucumber_rails' old-school web-steps have been deprecated for a while, urging developers to write high-level step definitions...

There is no reason to leave trailing whitespace characters in your project's files, so don't add any.

web.archive.org

TL;DR Avoid before(:context) (formerly before(:all)), use before(:example) (formerly before(:each)) instead. If you do use before...

to_file has been removed in Paperclip 3.0.1. Instead of using File to access Paperclip storage objects (like this: File.read...

makandra dev
davidwalsh.name

CSS transitions make your responsive websites smoother and more professional. It's easy and already there. Use it!

Given you store files on Amazon S3 and you need to stream those files out to people while you don...

Ever wanted autocompletion for paths from paths.rb in Cucumber? This card lets you write your steps like this:

dfcb.github.com

This plugin makes it easy to add fit-to-fill background video to websites. It can play silent ambient background...

StaticMatic is a nice tool to build simple static websites. In case you want to have some nifty styles on...

When you work in the MySQL console and you want to see which database is used, type: SELECT database();

We frequently use the handy Paperclip Gem to manage file attachments. If you need to move the files from local...

makandra dev
github.com

pjax loads HTML from your server into the current page without a full reload. It's ajax with real permalinks...

If you have an html_safe string, you won't be able to call gsub with a block and match...

If you want to update some records with boolean fields in a migration, always remember to set your values with...

A print stylesheet is easy to create. Choose a font suited for paper, hide some elements, done. Unfortunately print stylesheets...

This article describes how to reset MySQL's or MariaDB's root password on your workstation. It's meant for...

Assuming the following sunspot setup of the post class: class Post < ActiveRecord::Base searchable do text :title string :state

Note: Instead of using the method in this card, you probably want to use ActiveType's nested attributes which is...

Sometimes you need to look at the filter chain in specs. You can do it like that on Rails 2...

api.rubyonrails.org

Methods to remove e.g. order or conditions from an existing scope chain.