When selecting records in a date range, take care not to do it like this: start_date = Date.parse('2007-05...

Basically, you now need to know if your project uses a "real" time zone or :local, and if config.active_record.time_zone...

Code coverage is the ratio of code lines kissed by a test vs. the total number of lines in your...

The unix command line tool less is a good choice for browsing logfiles. In the standard configuration, though, it does...

github.com

When internationalizing your Rails app, you'll be replacing strings like 'Please enter your name' with t('.name_prompt'). You...

Submit buttons in Rails come with a useful option :disable_with which will disable the button when clicked and change...

developer.mozilla.org

List of non-standard CSS attributes that change how the browser resamples scaled images. Only use them if you know...

When you use google analytics to track your visitors interactions, you should ensure that it runs on your production site...

The SQL code generated by Graticule's spherical distance computation is insufficient and can lead to NULL distances in edge...

sequel.rubyforge.org

Seems like a useful gem for cases where ActiveRecord is overkill but you don't want to do everything by...

apidock.com

Using rename_column, remove_column, etc. more than once in a migration makes that migration run slower than it should...

When you have objects in your database that hold latitude and longitude and you want to find others that are...

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

When using state_machine you sometimes need to know whether an object may execute a certain transition. Let's take...

Clearance is a gem that provides authentication functionality (e.g. login, logout). This note explains, how the clearance login, logout and...

Look here for informations how you can show the MySQL default character set. At first you need the Amazon RDS...

Web fonts are awesome. After being restricted to Arial for two decades there is finally a cross-browser way to...

By default, Rails views escape HTML in any strings you insert. If you want to insert HTML verbatim, you need...

To show the collation of your tables you have to login to the MySQL console and execute SHOW TABLE STATUS...

To show the MySQL default character set you have to login to the MySQL console and execute SHOW VARIABLES LIKE...

linux.die.net

You can convert git commits into patch files. Those can be used to apply to a different repository [1] or...

stackoverflow.com

The solution in this card is based on a stack overflow post by Leventix. If you need to make request...

rubyinside.com

While 2.0 will include a number of syntax changes, new features and general improvements, mentioned below, it is anticipated to...

First keep in mind that :dependent => :destroy hooks into before_destroy. So when you use other before_destroy callbacks the...