So you want to use object-fit, but you also need to support Internet Explorer. One option is to use...

til.hashrocket.com

Apparently you can pash a second scope to a hash-condition and the whole thing will be evaluated as a...

This is quite an edge case, and appears like a bug in Rails (4.2.6) to me. Update: This is now...

Note: This applies to plain Ruby scripts, Rails does not have this issue. When you work with Ruby strings, those...

makandra dev
dev.mensfeld.pl

Ruby 2.3.0 has been around since end of 2015. It brings some pretty nice new features! Make sure to read...

You can download .gem files using gem fetch: gem fetch activesupport consul This will produce files like active-support-5.0.0.gem and consul-0.12.1.gem...

mitrev.net

As announced before, Ruby has introduced a safe navigation operator with version 2.3.0. receiver&.method prevents NoMethodErrors by intercepting method...

blog.blockscore.com

#dig lets you easily traverse nested hashes, arrays, or even a mix of them. It returns nil if any intermediate...

The following will search for all .feature files containing a search term and run them using geordi. find features/ -name...

github.com

Ever needed to use a global variable in Rails? Ugh, that's the worst. If you need global state, you...

Reading user input in console applications is usually done using Kernel#gets. Stubbing that can be a bit hairy.

When testing Ruby code that prints something to the terminal, you can test that output. Since RSpec 3.0 there is...

As you may know, HAML expands data attributes that are given as a hash: %div{ data: { count: 3 } }

PostgreSQL uses the C library's locale facilities for sorting strings: First, all the letters are compared, ignoring spaces and...

thoughtbot.github.io

Let's say you have two factories that share some attributes and traits: FactoryBot.define do factory :user do screen_name...

Converting string characters to or from their integer value (7-bit ASCII value or UTF-8 codepoint) can be done...

As your Rails project grows, you will accumulate a number of small patches. These will usually fix a bug in...

to create a Gallery that has a name and has_many :images, which in turn have a...

makandra dev

Connect to your IMAP server. If you have SSL enabled: openssl s_client -connect your-server:993 if your server...

relishapp.com

When you find yourself in the situation that you would like to define a custom matcher in your specs, but...

Many of our developers love to use the "awesome" window manager on Linux. However, RubyMine dialogs occasionally defocus while typing...

When you have a localized website, you may want to redirect users to their preferred language when they visit the...

github.com

Adds missing native PostgreSQL data types to ActiveRecord and convenient querying extensions for ActiveRecord and Arel for Rails 4.x...

When you paste copied code with CTRL+V, RubyMine will change the indentation of the pasted code. You can prevent...