Instead of running all missing migrations on your test database with rake db:migrate RAILS_ENV=test you can also...

When you are using the default MIME-Type configuration and your application allows uploading files, it can be a security...

...Safari, ...) or Firefox, this is only the initial size -- users can resize textareas to become bigger. This is helpful to the user, but may be breaking your application layout in...

This note describes a Cucumber step definition that lets you say: Then "Mow lawn" should be an option for "Activity...

As attachments to this card you will find a Cucumber feature and supplementing step definition that you can use to...

I had a huge MySQL dump that took forever (as in: days) to import, while I actually just wanted to...

We recently decided to put static content for HouseTrip.com to Amazon Cloudfront for a faster user experience. This happens fully...

Do all of the above, and also Remove all blocks and hooks belonging to craken from your config/deploy.rb. Delete vendor/plugins/craken. Check if you have lib/tasks/craken.rb. If so, delete...

makandra dev

The Rails asset pipeline improves delivery of application assets (javascripts, stylesheets, images, fonts). Here are some basic facts about its...

...hide gems from the backtrace. In such cases, log_subscriber.rb is the inner-most (i.e. "best") source in the backtrace. You probably have an initializer with this line: Rails.backtrace_cleaner.remove_silencers!

xaprb.com

The linked article explains how to get a database-wide lock without creating table rows: This article explains how I...

In my opinion using this plus the icon font you get the best of all worlds, with low CPU usage, no JavaScript, and file-sizes in the one...

redis.io

In production, you (or your ops team) should configure a maximum number of bytes that Redis can use to store...

...per group but only one value can be picked for the results. The default behaviour of MySQL prior to version 5.7 will not complain and arbitrarily choose a value. But...

blog.jayfields.com

Deprecated ways to execute shell code in Ruby This is just a reference for legacy code. For new code, always...

Inside before :each blocks you can refer to variables that you introduce via let later on. They do not need...

When the Ruby parser module of Ruby-GetText comes across a file in one of its search directories (e.g. lib/scripts...

When you use the send_file method to send a local file to the browser, you can save resources on...

...to a value. The validation is skipped silently when terms is nil. While this behavior is useful to validate acceptance in the frontend and not the admin backend, it also...

In a web application you often need to move data between the client (HTML, Javascript) and the server (Ruby, Rails...

...include(3, 4, 5) evaluates to: NOT( .to include(3, 4, 5) ) However, it behaves like: .to (NOT include(3) && NOT include(4) && NOT include(5) ) Warning

Active Record's select method allows you to make use of the power of MySQL select statements. On the one...

When paginating records, we usually need to know the number of total records in order to render pagination links. Popular...

web.archive.org

Capistrano 2 brings the shell command which allows you to run commands on your deployment targets. There is also invoke...