before(:all) runs the block once before all of the examples. before(:each) runs the block once before each...
...the file system. Since load order can be important, this may lead to different behavior on different machines which are hard to debug. Simply add a .sort: Dir.glob(Rails.root.join('lib/ext...
PostgreSQL offers a really handy field type: json. You can store any JSON there, in any structure. While its flexibility...
In the discussion of the difference between include and extend in Ruby, there is a misconception that extend would add...
The linked tool can be used to scan your CI/CD workflows for potential security issues and suboptimal defaults if they...
...often show or hide elements based on viewport dimensions, or may have components that behave differently (like mobile vs desktop navigation menus). Since you want your integration tests to behave...
...metrics". This allows you to configure dimensions larger than your display and enable/disable touch behavior. Simply use register_driver to set up a driver that you then connect to Capybara...
When your Rails application offers downloading a bunch of files as ZIP archive, you basically have two options:
While debugging an intricate issue with failed HTTP requests I have come to appreciate the more advanced features of the...
In general, you should not put a block element inside an inline element. So don't do this: text
It's possible to implement simple custom RuboCop cops with very little code. They work exactly the same like existing...
Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...
This Capistrano task runs a command on all servers. bundle exec cap production app:run cmd='zgrep -P "..." RAILS_ROOT/log/production.log...
When using Rails credentials, you will edit the encrypted credentials for staging or production environments from time to time. To...
I recently built a screen with a very high and wide table in the center. This posed some challenges:
This card describes different flavors for concatting HTML safe strings in a helper method in Rails. You might want to...
Creating records in specs can be so fast that two records created instantly after one another might have the same...
Most of our applications use CarrierWave for file uploads. CarrierWave has an integrated processing mechanism for different file versions with...
Text fragments allow linking directly to a specific portion of text in a web document, without requiring the author to...
When building an application that sends e-mails to users, you want to avoid those e-mails from being classified...
bundle outdated [--filter-major|--filter-minor|--filter-patch] Example output for bundle outdated --filter-major Other examples
Maintain this feature branch on a regular basis to not get too far behind production. Setup a reminder to either merge the branch or drop it. Inform the colleagues...
If you try to listen to events on elements that are nested inside a , Firefox will stop event propagation once...
Sometimes we have to write code that behaves differently based on the version of a specific gem or the Ruby Version itself. The version comparison can often be seen with...
Sometimes it is useful to define a named scope by implementing a static method with the scope's name on...