Sometimes you want to fetch associations for an ActiveRecord that you already loaded, e.g. when it has deeply nested associations...

github.com

There are three ways to define your own RSpec matchers, with increasing complexibility and options: 1) Use RSpec::Matchers.define

One option is to use partials. Or you can set the @template field to the name of another action:

When you create e.g. a sidebar box that contains headlines and paragraphs, the final paragraph's margin in that box...

When you need to add a event listener to hundreds of elements, this might slow down the browser. An alternative...

makandra dev

You may omit the /path/to/link_name to have a link with the same filename appear in the current directory

When deploying Rails applications you might have noticed that JS and CSS are not cached by all browsers.

nickstakenburg.com

Prototip allows you to easily create both simple and complex tooltips using the Prototype javascript framework. Please note: "Permission to...

infoq.com

A well-written API can be a great asset to the organization that wrote it and to all that use...

github.com

Boolean attributes can now be set by appending "which", "that" or "who" at the end: Given there is a movie...

When working with times and dates in Rails applications, you need to deal with the following problem: In Rails, Time...

jqueryui.com

This will eventually be integrated into jQuery UI with the multiple: true option, but right now this is the way...

Don't use should validate_format_of(...) because that matcher works in weird ways. Use the allow_value matcher instead...

Use this if you want to show or hide part of a form if certain options are selected or boxes...

ubuntuforums.org

Keyboard layout reverting to US on (every) reboot Cause: I found the same problem, but only on my wife...

regular-expressions.info

You can write regular expressions some different ways, e.g. /regex/ and %r{regex}. For examples, look here. Remember that it...

The Git stash does not work like a one-slot clipboard and you might shoot yourself in the foot if...

makandra dev

To pause and send a task to the background ctrl+z to reactivate the task fg to run task in...

Use the attached initializer to do stuff like this str = "abc" str.imbue(:foo => 'foo value', :bar => 'bar value')

So you screwed up and copied Paperclip secrets from one project to another. Here is a semi-automatic, painful way...

Capybara does not play nice with sites that have some actions protected by SSL, some not. A popular way to...

makandra dev
github.com

Our awesome collection of rspec helpers (formerly known as "spec_candy.rb") is now available as a gem. It works, it is...

makandra dev

The following counts all the lines in all *.rb files in the app directory. Run several of these commands to...

makandra dev

Show all sockets (Unix & TCP/UDP), both listening and established ones: netstat -anp To limit the output e.g. to listening TCP...