Ubuntu 12.04 LTS x64, Ruby 1.8.7, Rails 2.13, PDFKit 0.5.4, Phusion Passenger Apache 2 I ran into this, when I...
Whenever you create a table from a database migration, remember to add updated_at and created_at timestamps to that...
If you need to enable NewRelic monitoring on certain machines within the same Rails environment, a simple solution is to...
Ubuntu has a package mysql-sandbox that lets you install multiple MySQL versions into your user home: Install mysql-sandbox...
Rails has always included a scaffold script that generates a default controller implementation for you. Unfortunately that generated controller is...
It is good programming practice to Don't Repeat Yourself (or DRY). In Ruby on Rails we keep our code...
You might not know that Rails disables CSRF protection in tests. This means that if you accidentally forget to send...
Copy the attached file to features/support. This gets you a convenience method: Capybara.javascript_test? Is true for Selenium, capybara-webkit...
Chrome extension that shows all info from your rails log (like parameters, response times, view rendering times, DB requests) inside...
If you want to have routes that are only available in tests (e.g. for testing obscure redirects), you can use...
When writing Rails migrations to convert a string column to an integer you'd usually say: change_column :table_name...
So you're switching to PostgreSQL from MySQL? Here is some help... General hints on PostgreSQL \? opens the command overview...
Using text-transform: uppercase - especially on form labels - can cause you serious headaches in Selenium tests. Sometimes the web driver...
dusen 0.4.8 and edge_rider 0.2.3 no longer depend on Rails (they still depend on ActiveRecord). That means you can...
With Rails 4, Concerns have become the “official” solution to the big-models problem. However, there’s a fair amount...
We’ve been working on one of our first Angular projects with a Rails backend. It’s been a great...
In order to keep the controllers directory tidy, we recently started to namespace controllers. With the :controller option you can...
When you're writing migrations that do more than changing tables (like, modify many records) you may want some output...
Custom matchers are a useful RSpec feature which you can use to DRY up repetitive expectations in your specs. Unfortunately...
Shared example groups are a useful RSpec feature. Unfortunately the default directory structure generated by rspec-rails has no obvious...
In Rails 5 you can say: ApplicationController.render( :template => 'users/index', :layout => 'my_layout', :assigns => { users: @users } ) If a Request Environment is...
Simply give the select helper an option :disabled, passing either a single value or an array. You need to specify...
Using CSS sprites for background images is a technique for optimizing page load time by combining smaller images into a...
Next time you have to do more than trivial CSS changes on a project, you probably want to have live...