Rails 4 introduced raising an error on pending migrations. This is most annoying when you are crafting a migration but...

Starting with Rails 4.0, when you get an exception reported via the ExceptionNotification gem, you will only see a very...

github.com

Rails 5 will introduce ActiveRecord::Relation#or. On Rails 4 and 3.2 you can use the activerecord_any_of gem...

To safely transport an arbitrary string within a URL, you need to percent-encode characters that have a particular meaning...

You may encounter problems with passenger starting an application with an updated rails. If you find an error like this...

You can include files from app/assets or from the public folder with javascript_include_tag. The subtle difference that tells...

A word of caution There should rarely be a reason for you to split up config/routes.rb. If you need to...

github.com

MarcoPolo shows your app name and environment in your console prompt so you don't accidentally break production Officially supporting...

Here is how to start your Rails application to accept both HTTP and HTTPS in development. gem install passenger

makandra dev
bootswatch.com

Free Bootstrap theme resembling Material Design. Bootswatch offers Sass and Less files, so the theme can easily be integrated into...

The migration DSL now supports adding and removing foreign keys. They are dumped to schema.rb as well. At this time...

leomayleomay.github.io

Your after_commit callbacks will not know about changes, as Rails discards them when committing. The linked article shows a...

nateberkopec.com

Very detailed guide to caching Ruby on Rails. Goes well with the official Rails guide on caching.

When using ORDER BY "column" in PostgreSQL, NULL values will come last. When using ORDER BY "column" DESC, NULLs will...

Rails comes with grouped_collection_select that appears to be useful, but isn't. As an alternative, consider the flat...

Note: ActiveRecord::Base#becomes has a lot of quirks and inconsistent behavior. You probably want to use ActiveType.cast instead.

guides.rubyonrails.org

Starting from 4.1, Rails automatically detects the inverse of an association, based on heuristics. Unfortunately, it does not seem to...

postgresql.org

There is no such thing as a "default order" of rows in database tables. For instance, when you paginate a...

makandra dev
api.rubyonrails.org

ActiveModel supplies an errors object that behaves similar to a Hash. It can be used to add errors to a...

makandra dev
semaphoreci.com

Capistrano 3 is a major rework of the framework and requires several adjustments to your deploy configuration files. The biggest...

Please don't use the horrible datetime_select helper. It has a terrible UI. Always prefer to use a visual...

You might wonder about this request in your test.log: Started GET "/__identify__" for 127.0.0.1 at 2015-04-29 18:00...

gist.github.com

Re-creating a complex ActiveRecord scenario quickly without setting up a full-blown Rails app can come in handy e.g...

Several Rails migration methods accept index: true as an option to create an index. In some cases (like #add_column...