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...

You know that you can force absolute URLs throughout a response. Now you want to modify URLs similarly, but only...

navy 0.5.1+ gives empty navigation containers a CSS class .navy-empty which you can hide via .navy-navigation &.navy-empty...

darwinweb.net

Hopefully you are using Psych for everything, but if you have legacy Syck YAML files lying around you could be...

For two years we've been using SearchableTrait which gives models the ability to process Googlesque queries like this: Contact.search...

Xfce gives you a million options to configure your panels. Together with Xfce's sometimes arcane configuration UI, this can...

blog.pivotal.io

So you are debugging like a boss and lost track of where you actually are in your code? No problem...

progfu.com

I am talking about development speed. When your application starts growing and you start adding gems, it starts to take...

makandra dev
github.com

The gem author Jonas Nicklas highlights in a Google Groups post that the release is not backwards compatible to 1...

The very useful andand gem does not play very nice with Ruby's SimpleDelegator (or vice versa). This following will...

If you get a stacktrace complaining about uninitialized constant MysqlCompat::MysqlRes a system library update might broke your gem.

perlstalker.vuser.org

While you can set your own font in your terminal or other tools, it will not change the default "Monospace...

The classical scenario: There's a parent div element and you want to center some arbitrary child element vertically inside...

When you have two models in a has_many, has_one or belongs_to association, the :inverse_of option in...

Capybara gives you two different methods for executing Javascript: page.evaluate_script("$('input').focus()") page.execute_script("$('input').focus()")

Rarely, you might want to rebuild all gems with native extensions, because they might be compiled against outdated system libraries...

YourClass.reflect_on_all_associations.map(&:name) Get the class name by calling class_name, or the type of the association (belongs_to, has_many...

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...

stackoverflow.com

url = 'http://www.foocorp.com/foo/bar' URI.parse(url).host # => www.foocorp.com Note that this will raise an error if the given argument is...

In theory you can take any scope and extend it with additional joins or conditions. We call this chaining scopes...

ActiveModel::Errors is used to handle validation errors on Rails objects. If you inspect an instance, it feels like a...

vimeo.com

Hashrocket Lunch n' Learn #1 with Avdi Grimm: Making Little Classes out of Big Ones A look at the pros...