Fixed bugs where calling valid? would change the record's state.

github.com

You can use .ids on an ActiveRecord scope to pluck all the ids of the relation: # Modern Rails User.where("users.name...

From at least Rails 4, the ActionView tag helper turns Array values of HTML options into a single space-separated...

Webpacker is Rails' way of integrating Webpack, and version 4 has been released just a few days ago, allowing us...

Rails' params hash contains any request parameters (URL parameters or request payload) as well as routing parameters like :controller, :action...

Today's cameras create huge images, some beyond 50MB. Unless you need to offer this large files, you should always...

github.com

See the attached link for a useful overview of modern (and classic) DOM API methods, like matches, contains, append, cssText...

Carrierwave includes some handy helper methods you can use to resize your images. Here is a quick summary of them...

...get no results (-01-23 would have worked). Serial numbers (one case was s7-1500) pose similar problems. Potential solution One possibility is to use plain old LIKE queries:

Spammers have started abusing other application to send their spam. This works like this: The application has some form that...

When restoring a PostgreSQL dump using pg_restore, you usually add the --clean flag to remove any existing data from...

When building an application that sends e-mails to users, you want to avoid those e-mails from being classified...

If your app does not need to support IE11, you can use most ES6 features without a build step. Just...

makandra dev
developer.mozilla.org

The standard way to abort async code is that your function takes a AbortSignal { signal } property. The caller can use...

Remember How to skip Sprockets asset compile during Capistrano deployment and Automatically skipping asset compilation when assets have not changed...

When doing Basic Authentication, your browser will send an "Authorization" header. Its value is simply a Base64-encoded representation of...

makandra dev

To restart all tasks monitored by God, don't use god restart. This command is only meant to soft-restart...

The rendered font often depends on the local font your system provides, therefore you often find a rule like below...

stackoverflow.com

To reload a single-item association in Rails 5+, call #reload_ : post.reload_author In older Railses you can say

Cucumber factory supports polymorphic associations out of the box. Just keep in mind that you need to use named associations...

Cucumber has an output format that prints step definitions only. You can use this to find unused ones: Temporarily add...

When upgrading Rails versions -- especially major versions -- you will run into a lot of unique issues, depending on the exact...

The Ace editor is a great enhancement when you want users to supply some kind of code (HTML, JavaScript, Ruby...

jakearchibald.github.io

There are many ways to optimize SVGs. Ideally, your build pipeline does that automatically for you (e.g. via postcss-svgo...