stackoverflow.blog

A rough guide how to implement a REST API. The discussion here includes some interesting points as well: Timestamps: ISO8601...

bundle outdated [--filter-major|--filter-minor|--filter-patch] Example output for bundle outdated --filter-major Other examples

getbootstrap.com

Recently I made an upgrade from Bootstrap 3 to Bootstrap 4 in a bigger project. Here are some tips how...

makandra dev

Rails 6 includes a WYSIWYG editor, Action Text. It works out of the box quite well, but chances are that...

johnnunemaker.com

PostgreSQL has partial indexes. With a partial index you tell Postgres to only index rows matching a given query.

Rails supports alert and notice as default flash types. This allows you to use these keys as options in e.g...

SSHKit 1.9.0 might fail with the following error, when trying to deploy a Rail application. Upgrading the gem to version...

When deploying a Rails application that is using Webpacker and Capistrano, there are a few configuration tweaks that optimize the...

IRB 1.2 (shipped with Ruby 2.7, but works on 2.5+) brings pretty syntax highlighting and multiline cursor navigation. However, pasting...

tekin.co.uk

Git diffs show the surrounding contexts for diff hunks. It does so by applying regular expressions to find the beginning...

Sometimes you want to find the inverse of an ActiveRecord scope. Depending on what you want to achieve, this is...

On some of our older projects, we use the mysql2 gem. Unfortunately, versions 0.2.x (required for Rails 2.3) and...

It sometimes happen that a database dump, that would want to insert into your development database, does not match the...

makandra dev

If you're using the webdrivers gem and VCR together, depending on your configuration, VCR will yell at you regulary...

If a model inherits from others or uses many concerns / traits, it might be hard to see in the code...

When logging in Rails, you can use the log_tags configuration option to add extra information to each line, like...

If you want to get the path of a file relative to another, you can use the expand_path method...

Rails 5.2+ supports "verbose query logs" where it shows the source of a query in the application log.

makandra dev
medium.com

In Ruby on Rails, all the routes of a given application can be found within the config/routes.rb file.

Rails middlewares are small code pieces that wrap requests to the application. The first middleware gets passed the request, invokes...

makandra dev

If you have a Ruby Pathname, you can use the method :/ to append filepaths to it. With this method, Ruby...

If you migrate a Rails application from Sprockets to Webpack(er), you can either transpile your CoffeeScript files to JavaScript...

CSP hat zum Ziel einen Browser-seitigen Mechanismus zu schaffen um einige Angriffe auf Webseiten zu verhindern, hauptsächlich XSS...

island94.org

GoodJob is a new background worker gem. It's compatible with ActiveJob. We're huge fans of Sidekiq for its...