We frequently use the handy Paperclip Gem to manage file attachments. If you need to move the files from local...
pjax loads HTML from your server into the current page without a full reload. It's ajax with real permalinks...
If you have an html_safe string, you won't be able to call gsub with a block and match...
If you want to update some records with boolean fields in a migration, always remember to set your values with...
A print stylesheet is easy to create. Choose a font suited for paper, hide some elements, done. Unfortunately print stylesheets...
This article describes how to reset MySQL's or MariaDB's root password on your workstation. It's meant for...
Assuming the following sunspot setup of the post class: class Post < ActiveRecord::Base searchable do text :title string :state
Note: Instead of using the method in this card, you probably want to use ActiveType's nested attributes which is...
Sometimes you need to look at the filter chain in specs. You can do it like that on Rails 2...
Methods to remove e.g. order or conditions from an existing scope chain.
So your Cucumber feature sometimes dies with this exception: Modal Dialog Present (Selenium::WebDriver::Error::UnhandledAlertError) As a seasoned Selenium...
How delayed jobs can make your after_save callbacks execute before the record is saved.
For string columns, MySQL indexes the left side of a string. That means an index can speed a like query...
Be careful when stubbing out attributes on records that are defined by associations. Nothing is as it seems to be...
No big features, but many improvements under the hood: Faster selector engine Many bug fixes Note that jQuery 2.0, scheduled...
So you got this error, even though your Gemfile bundles mysql2: !!! Missing the mysql2 gem. Add it to your Gemfile...
The next version of MySQL will include a built-in memcached daemon. This daemon can quickly get and set key/value...
assignable_values now lets you define a secondary default that is only used if the primary default value is not...
You can use String#demodulize from ActiveSupport: "ActiveRecord::CoreExtensions::String::Inflections".demodulize # => "Inflections" "Inflections".demodulize # => "Inflections"
Don't say is_a?(ActiveRecord::NamedScope::Scope) because that is no longer true in Rails 3 and also doesn...
paper_trail is an excellent gem to track record versions and changes. You almost never want to reimplement something like...
Unless you changed the default, this will be 16 MB: mysql> SHOW VARIABLES WHERE Variable_name="max_allowed_packet"; +--------------------+----------+
Sometimes, you may want to open up a second database connection, to a read slave or another database. When doing...
Take care in queries where multiple AND or OR operators are used. In doubt, always use braces to enforce precedence...