beust.com

It’s pretty common for projects hosted on GitHub to receive “pull requests”: requests from people who have cloned your...

Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']) or a hash (:conditions => { 'state' => 'draft...

youtube.com

power-rake db:migrate VERSION=20100913132321 By default the environments development, test, cucumber and performance are considered...

To only run a single describe/context block in a long spec, you can say spec spec/models/note_spec.rb:545 ... where the describe...

There are many different methods that allow mapping an Array to a Hash in Ruby. Array#to_h with a...

This will show you how to create a RSS feed that the Feed Validator considers valid. Note that RSS is...

In modern Rails versions you can also use ActiveRecord's pluck method. User.active.pluck(:id) => [1, 5, 23, 42]

makandra dev

If you want to rename a key of a Ruby hash, this could help you out. Just put it into...

images.google.com

In july Google announced a new version of their image serach tool Google Images. But you won't find it...

First of all: You could just use RVM which would make the pain go away. If for some reason you...

github.com

You can use the whatlanguage gem to detect the language of a Ruby string. Note that it also has not...

Be careful! The following solution will delete files on a volume. If you don't know exactly what you're...

paulirish.com

Cached fonts WILL caused an unstyled flash of text.

emphaticsolutions.com

In a great post about named routes in Rails, path vs. url, Viget Labs ponders which variant is best used...

yehudakatz.com

This post explains, in some detail, how we will implement a nice performance boost for Rails developers. Understanding the details...

wmd-editor.com

WMD is a simple, lightweight HTML editor for blog comments, forum posts, and basic content management. You can add WMD...

Expiration of Rails sessions By default Rails sessions expire when the user closes her browser window. To change this edit...

When submitting textareas, browsers sometimes include carriage returns (\r) instead of just line feeds (\n) at the end of each...

If you iterate over a collection of arrays, you can destructure the arrays within the block parameters: movies_and_directors...

When a spec only runs when it is called directly, but not as part of the whole test suite, make...

Since RubyMine 3.1 you can drag tabs across panes/windows and out of the main window to create new windows.

Call with the server's hostname (and user if you have no SSH agent), e.g. install-gems-remotely my.server.com

makandra dev

There are two distinct ways of commenting Haml markup: HTML and Ruby. HTML comments This will create an HTML comment...