How to open files from better_errors with RubyMine on Linux

Posted 10 months ago by Michael Leimstädtner.

I recently noticed that better_errors allows you to to open files from within your favorite editor. However it was...

Chromedriver: Connect local chromedriver with docker

Posted 10 months ago by Emanuel.

Debugging your integration tests, that run a headless Chrome inside a docker image, is tricky. In many cases you can...

Allow capybara to click on labels instead of inputs for checkboxes

Posted 11 months ago by Max E..

Within Capybara you most certainly use the #check- and #uncheck-method to (un)check checkboxes. But there's one problem...

The numericality validator does not care about your BigDecimal precision

Posted 11 months ago by Michael Leimstädtner.

Looking at the source code of the validates_numericality_of validator, it becomes clear that it converts the attribute in...

Preventing users from uploading malicious content

Posted 11 months ago by Henning Koch.

When you allow file uploads in your app, a user might upload content that hurts other users. Our primary concern...

Rails: Fixing ETags that never match

Posted 11 months ago by Henning Koch.

Every Rails response has a default ETag header. In theory this would enable caching for multiple requests to the same...

Modern CSS supports individual transform properties

Posted 11 months ago by Arne Hartherz.

tl;dr Individual transform properties are great because they allow you to write more readable and maintainable CSS, especially when...

Jasmine: Preventing unhandled promise rejections from failing your test

Posted 11 months ago by Henning Koch.

You have an async function that rejects: async function failingFunction() { throw new Error("Something went wrong") } When you call that...

Sidekiq 7: Rate limiting with capsules

Posted 12 months ago by Emanuel.

Sidekiq 7 adds a new feature called capsules. Use cases: a chrome queue limited to 1 for e.g. PDF processing...

How to create a multiline map in SASS/SCSS

Posted 12 months ago by Max E..

If you want to to create maps within SASS/SCSS-files, it normally works like this: $some-map: (key1: value1, key2: value2...

Rubymine: Configure CTRL + ALT + SHIFT + c to work with "Test Source Roots"

Posted 12 months ago by Emanuel.

To navigate between test and test subject Rubymine requires you to set the test root sources as Test Sources Root...

Breaking changes for boolean attributes in HAML 6

Posted 12 months ago by Emanuel.

Haml 6 has some breaking changes regarding boolean attributes. Only the following attributes and aria/data attributes are considered boolean attributes...

Using Capybara finder methods with arbitrary matching conditions

Posted 12 months ago by Henning Koch.

Capybara has a variety of finder methods like find_button to help you look up DOM elements. There are also...

Simple Form: Rendering errors without an appropriate attribute

Posted 12 months ago by Emanuel.

Usually you add errors to :base in ActiveRecord, in case no appropriate attribute could be used to add the error...

Project management best practices: Technical debt summary

Posted 12 months ago by Emanuel.

Maintaining larger projects makes it more difficult to balance refactoring and upgrade tasks according to its actual value. Consider to...

Rails: Assigning associations via HTML forms

Posted 12 months ago by Emanuel.

Let's say we have posts with an attribute title that is mandatory. Our example feature request is to tag...

Rails: Rescuing exceptions for specific exception types

Posted 12 months ago by Emanuel.

By default most exceptions in Rails will render a 500 error page and will create a new issue in your...

Beware when using ActiveSupport time and date calculation methods

Posted About 1 year ago by Bruno Sedler.

Rails Active Support provides some helpful methods for calculating times and dates, like Duration#ago or Duration#from...

Rails: Composing an ETag from multiple records

Posted About 1 year ago by Henning Koch.

Rails offers the fresh_when method to automatically compute an ETag from the given record, array of records or scope...

Rails: Your index actions probably want strict_loading

Posted About 1 year ago by Henning Koch.

By activating strict_loading you force developers to address n+1 queries by preloading all associations used in the index...

Rails: How to test the parsed response body

Posted About 1 year ago by Emanuel.

Testing your responses in Rails allows to parse the body depending on the response MIME type with parsed_body.

How to exclusively lock file access in ruby

Posted About 1 year ago by Felix Eschey.
ruby-doc.org

We will achieve this by creating a block accepting method to optionally create and then lock a .lock File of...

Rails migration: Changing a column type without losing the content

Posted About 1 year ago by Jakob Scholz.

The change_column method for rails migrations support casting with a custom SQL statement. This allows us to change a...

CSS: CSS Container Queries

Posted About 1 year ago by Emanuel.
developer.mozilla.org

Container queries enable you to apply styles to an element based on the size of the element's container. If...