When you're using Sidekiq::Web to monitor the Sidekiq status AND have your session cookie configured to a wildcard...
When attempting to update RubyGems, depending on updates your previously performed, you might run into an error ERROR: While executing...
We're usually running Ubuntu LTS versions. Sometimes newer hardware requires packages from more recent Ubuntu releases that only come...
A common pattern in Ruby is to to require all files in a specific diretory, using something like Dir.glob(Rails.root.join...
An end-to-end test (E2E test) is a script that remote-controls a web browser with tools like Selenium...
Browsers support different types of redirects. Be very careful with these status codes: 301 Moved Permanently 308 Permanent Redirect
When you want to group rails models of a logical context, namespaces are your friend. However, if you have a...
Let's say you have a form that you render a few times but you would like to customize your...
After loading a staging dump into development, you might get an ActiveRecord::EnvironmentMismatchError when trying to replace the database (like...
When localizing model attributes via I18n you may run into errors like this: I18n::InvalidPluralizationData: translation data {...
...} can not be...
If another session is accessing your database you are trying to reset or drop you might have seen the following...
Use return to return from a method. return accepts a value that will be the return value of the...
I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method...
before(:all) runs the block once before all of the examples. before(:each) runs the block once before each...
There are many approaches out there how you can import data from a legacy application to a new application. Here...
Use Traim to build a RESTful API for your ActiveRecord models with very little code. Traim assumes your API resources...
In the ruby shell (IRB) and rails console the return value of the previous command is saved in _ (underscore). This...
ImageMagick can automatically crop surrounding transparent pixels from an image: convert input.png -trim +repage output.png
Rails 5 (don't know about the others) comes with an initializer wrap_parameters.rb. Here you can tell rails to wrap...
Put the line below in the respective env.rb file to make your action controllers raise an ActionController::UnpermittedParameters error when...
First, go to the webinterface of your phone. Choose Software Update in the navigation on the left. Next, you have...
Webpack is the future. We're using it in our latest Rails applications. For tests, we want to compile assets...
Rails default config uses the ActiveSupport::Cache::NullStore and disables controller caching for all environments except production: config.action_controller.perform_caching = false...
If you use the Better Errors gem, you will sometimes notice that it can be very slow. This is because...