If you require your Rails models manually, pay attention to the path you use. Unless you have...
If your application has forms to edit string fields, you probably want to strip the entered values (remove whitespace from...
“Fat models” cause maintenance issues in large apps. Only incrementally better than cluttering controllers with domain logic, they usually represent...
Richard Powell presents a collection of CSS styling advice that's mainly taken from SMACSS. Although at makandra we're...
The linked slidedeck holds many tips, of which I list the most interesting to me below DATA and END
The __END__ keyword tells Ruby where a file ends – but you don't have to stop there. Any text you...
Ruby's mathn library changes Fixnum division to work with exact Rationals, so 2 / 3 => 0 2 / 3 * 3 => 0...
If you get this warning on your local machine one of these steps might help: Rebuilt the gem with the...
Never ever declare your associations with a string, especially when doing metaprogramming. A common mistake is something like # WRONG
If this happens to you: user.avatar = Avatar.new user.avatar # => nil (where avatar is a belongs_to), you probably declared your association...
You're using exception_notification and want to send exception mails within a model. Here's how. The ExceptionNotifier class...
There is no reason to leave trailing whitespace characters in your project's files, so don't add any.
Today I got a better understanding of how git works, in particular what git checkout and git reset do.
Simply use OpenStruct#to_h to receive an OpenStruct's hash representation. In older Rubies you need OpenStruct#marshal_dump...
simple_format ignores Rails' XSS protection. Even when called with an unsafe string, HTML characters will not be escaped or...
Given you store files on Amazon S3 and you need to stream those files out to people while you don...
Ever wanted autocompletion for paths from paths.rb in Cucumber? This card lets you write your steps like this:
StaticMatic is a nice tool to build simple static websites. In case you want to have some nifty styles on...
Note: Modern Rails has two build pipelines, the asset pipeline (or "Sprockets") and Webpacker. The principles below apply for both...
When you get an error like this: Invalid gemspec in [/opt/www/foo-project.makandra.de/shared/bundle/ruby/1.8/specifications/carrierwave-0.6.2.gemspec]: Illformed requirement ["# 1.1.4"] ... the machine's Rubygems needs to...
Under certain circumstances gettext_i18n_rails will hit a near-infinite loop. This occured in Rails 2.3.5 with Haml 3.0.18...
If a customer calls and tells you that she cannot see some content of her website beware of the following...
If you have an html_safe string, you won't be able to call gsub with a block and match...
If (for some reason that you don't want to ask yourself) you need to know all classes that define...