Rails comes with grouped_collection_select that appears to be useful, but isn't. As an alternative, consider the flat...

github.com

When working with ActiveType you will often find it useful to cast an ActiveRecord instance to its extended ActiveType::Record...

Note: ActiveRecord::Base#becomes has a lot of quirks and inconsistent behavior. You probably want to use ActiveType.cast instead.

To disable the mostly useless automatic suggestion popups in RubyMine, go to File / Settings, then to Editor / General / Code Completion...

guides.rubyonrails.org

Starting from 4.1, Rails automatically detects the inverse of an association, based on heuristics. Unfortunately, it does not seem to...

Since version 2.6 exception notifier distinguishes between foreground and background sections. The reason is that with background jobs (e.g. methods...

devalot.com

Good article about ruby singleton classes.

api.rubyonrails.org

ActiveModel supplies an errors object that behaves similar to a Hash. It can be used to add errors to a...

Developing complex regular expressions quickly blows my mind. Here are some online regex editors that help you by highlighting matching...

Note: Making a reverse proxy with nginx is much more straightforward. A reverse proxy is a "man in the middle...

When you register a delegated event using on (or the deprecated delegate / live), it is somewhat hard to manually trigger...

caniuse.com

All major browsers (IE8+, FF3.5+, Safari 4+, any Chrome) support sessionStorage, a JavaScript storage object that survives page reloads and...

semaphoreci.com

Capistrano 3 is a major rework of the framework and requires several adjustments to your deploy configuration files. The biggest...

github.com

If you have FactoryGirl traits like this: factory :movie do title 'Sunshine' year 2007 trait :vintage do year 1951

FactoryBot.define do factory :parent do transient do child_name nil child_allowed_to_drive false end child do association(:child...

askubuntu.com

I was annoyed that RubyMine's autocompletion did not work via Ctrl+Space for me. In fact, it did not...

After adding a vdisk to an ESXi linux guest you will assert that you can't find a new device...

bevacqua.github.io

Datetime picker that offers: simple UI without a specific framework several of customization options allows custom date/time validations Localization happens...

When you have an element you want to hide, you can add a ng-show='isOpen' attribute to that element...

forum.openoffice.org

If you're a frequent user of LibreOffice, I strongly recommend to checkout out the VLOOKUP function (SVERWEIS in German...

gist.github.com

Re-creating a complex ActiveRecord scenario quickly without setting up a full-blown Rails app can come in handy e.g...

Several Rails migration methods accept index: true as an option to create an index. In some cases (like #add_column...

makandra dev
plugins.jetbrains.com

There are times when you have a chunk of text that you want to do something with, e.g. replace something...

bugs.ruby-lang.org

TL;DR Under certain circumstances, dynamically defined symbols may break keyword arguments in Ruby 2.2. This was fixed in Ruby...