When you use will_paginage to paginate a scope, and you want to obtain the total number of records matched...
There is a problem with AJAX response handling for Rails 3 remote links and forms in Internet Explorer. This problem...
For clarity and traceability, your commit messages should include the ID and title of the Pivotal Tracker story you're...
You most likely never want to do this. But if you do: Model.update_all({:id => new_id}, {:id => old_id...
To only run the next two migrations: rake db:migrate STEP=2 To revert the previous two migrations:
Use this scope: class Stick named_scope :shuffled, lambda { last_record = last { :conditions => [ 'id >= ?', rand(last_record.id) ] } if last_record }
CONCAT('foo', 'bar', NULL) = NULL the NULL always wins in MySQL. If you would rather treat NULL as...
Use this MySQL command to show further info about a table: SHOW CREATE TABLE tags; This will output a table...
You can now add an :inverse_of option to has_one, has_many and belongs_to associations.... Without :inverse_of...
Be careful when using params.merge as params is a HashWithIndifferentAccess. Why? Usually this should not be an issue but it...
Be careful when memoizing a method that returns a scope, e.g.: def variants scoped(:conditions => { :name => name }) end memoize :variants...
When using form_for you can give the form's target URL either as a string or an array:
The timepicker addon adds a timepicker to jQuery UI Datepicker, thus the datepicker (jQueryUI) is required for using any of...
If you previously used version 2.x of Thunderbird and upgraded to 3.x (for example through an Ubuntu release...
The ancestry gem allows you to easily use tree structures in your Rails application. There is one somewhat unobvious pitfall...
If you need to look at the list of methods that are called upon certain events (like before/after saving etc...
If you get an ActiveRecord::RecordNotSaved error, a method inside one of your model's callback chains (before_save etc...
When you do tags with acts-as-taggable-on and want to preload associated tags, you can do so with...
Did you use the :select option in a find, and forgot to include foo?
If you want to see how long your database queries actually take, you need to disable MySQL's query cache...
Hooks lets you define hooks declaratively in your ruby class. You can add callbacks to your hook, which will be...
It can be useful to have a Ruby expression like condition ? positive_case : negative_case in MySQL queries:
A good tool to generate strong passwords and secrets is "apg". You can get it with sudo apt-get install...
You need to install the following packages before you can build the Paperclip gem: sudo apt-get install imagemagick librmagick...