Lets say we have a user with a contract whereas contract is a mounted carrierwave file. Now we want to...
You might have some trouble running a Rails LTS 2 app with MySQL 5.7. If you don't want to...
MySQL and MariaDB have an SQL mode setting which changes how MySQL behaves. The SQL mode value is comprised of...
Rails offers a way to prepend (or append) view paths for the current request. This way, you can make the...
When you have string contents (e.g. a generated binary stream, or data from a remote source) that you want to...
You need to update a lof gems. Make sure you don't have any version constraints in your...
Running rails server will start a local server that you can access via http://localhost:3000. When you are working...
Use bundler > 1.15 to fix Gem::LOADED_SPECS_MUTEX (NameError). Given the following project: ruby -v ruby 1.8.7
When your Rails controller calls render, you can pass a :status option for the HTTP status code: render 'results', status...
When a Rails controller action should handle both HTML and JSON responses, do not use request.xhr? to decide that. Use...
Katapult 0.3.0 brings Rails 5 and Ruby 2.5 support with a new design, plus a ton of smaller features, fixes...
If your Rails application is using Webpack you need to serve assets on the same host as you application runs...
ActiveSupport::Dependencies takes care of auto-loading any classes in development. This is usually useful, but when you run into...
This is a small example on how you can check if your Postgres index can be used by a specific...
The issue: You are using stub_const to change a constant value for your test. stub_const "SomeClass::CONST", 'test...
This error is raised because your old database does not have a configured environment yet, which Rails 5 enforces.
Rails applications and ruby gems should have a README that gives the reader a quick overview of the project. Its...
You should avoid using application models in your migrations. But how else could you create records in a migration?
PostgreSQL supports the SQL OVERLAPS operator. You can use it to test if two date ranges overlap: => SELECT ('2001-02...
In most projects I know, Cucumber test suite speed is not an issue. Of course, running 350 features takes its...
When you're using Sidekiq::Web to monitor the Sidekiq status AND have your session cookie configured to a wildcard...
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