I’ve worked on huge applications in Ruby and Rails before. I very much want to believe in DCI, but...
Axlsx is an incredible gem to generate "Office Open XML" spreadsheet files (XLSX). Does not break on large spreadsheets and...
TLDR: In tests you need to clean out the database before each example. Use :transaction where possible. Use :deletion for...
When searching for text in a MySQL table, you have two choices: The LIKE operator FULLTEXT indexes (which currently only...
Static error pages To add a few basic styles to the default error pages in Rails, just edit the default...
If - for whatever reason - you have to render stylesheets dynamically, the following snippet might be of help. It emulates what...
Our old solution for cronjobs, the "craken" plugin, is no longer maintained and does not work on Rails 3.2+.
You know that you can force absolute URLs throughout a response. Now you want to modify URLs similarly, but only...
ActiveRecord has a feature called counter caching where the containing record in a has_many relationship caches the...
In Rails 2, when calling instance_eval or instance_exec on a scope, the scope will fetch its records from...
I am talking about development speed. When your application starts growing and you start adding gems, it starts to take...
The gem author Jonas Nicklas highlights in a Google Groups post that the release is not backwards compatible to 1...
When you have two models in a has_many, has_one or belongs_to association, the :inverse_of option in...
Installation differs slightly from older versions, please check the README.
Icon fonts like Font Awesome are infinitely scalable, look great on high-DPI displays and will give your app a...
Under certain (unknown) circumstances, Rails will give localized files an invalid content-type in the Response header. For me, after...
ActiveModel::Errors is used to handle validation errors on Rails objects. If you inspect an instance, it feels like a...
If you require your Rails models manually, pay attention to the path you use. Unless you have...
In a Rails application, *_spec.rb files get special treatment depending on the file's directory. E.g. when you put a...
Ruby's mathn library changes Fixnum division to work with exact Rationals, so 2 / 3 => 0 2 / 3 * 3 => 0...
If some of your JavaScripts fail on Internet Explorer, but only in staging or production environments, chances are that JavaScript...
Never ever declare your associations with a string, especially when doing metaprogramming. A common mistake is something like # WRONG
The ActionMailer in Rails 2 depends on a buggy version of TMail, which sometimes inserts a blank line into the...
simple_format ignores Rails' XSS protection. Even when called with an unsafe string, HTML characters will not be escaped or...