When you have a string containing umlauts which don't behave as expected (are not matched with a regexp, can...
Warnings like those below may originate from rspec or shoulda-matchers or other gems that have not updated yet to...
ActiveRecord caches results of SQL queries. If you want to discard the cached results for one model, you can call...
SimpleForm is a great approach to simplifying your forms, and it comes with lots of well-defined input types. However...
So you want your Ruby script to install missing gems instead of dying? Take this method: def installing_missing_gems...
I use this to simulate the (non-existing) :last-letter CSS pseudoclass, e. g. to insert a tombstone at the...
If you parse this Yaml ... yes: 'Totally' no: 'Nope' ... you get this Ruby hash: { true: 'Totally', false: 'Nope' }
You are probably using Ruby 1.8.7 with a too recent versions of Rubygems. Downgrade your Rubygems to the latest version...
There are 3 built-in file descriptors: stdin, stdout and stderr (std=standard). (You can define your own, see the...
Create, or edit your ~/.irbrc file to include: require 'irb/ext/eval_history' # was 'irb/ext/save-history' for versions prior to Ruby 3.3 IRB.conf[:SAVE...
Edge Rider gives your relations a method #origin_class that returns the class the relation is based on.
Spring is a Rails application preloader. When debugging e.g. the rails gem, you'll be wondering why your raise, puts...
MenuetOS is an Operating System in development for the PC written entirely in 32/64 bit assembly language. Menuet64 is released...
Programatically invoke Rails generators Require the generator, instantiate it and invoke it (because generators are Thor::Groups, you need...
docopt helps you define interface for your command-line app, and automatically generate parser for it. docopt is based on...
Rubygems can produce lots of deprecation warnings, but sometimes, you cannot fix them. To have a tidy terminal with output...
When you want the table headers to always stay around (e.g. because that table is huuuge), use the code below...
If you want to label things with a color but don't actually care which cholor, you can use the...
So you have a restangular collection and you want to remove an element from it, after you've successfully deleted...
If you regularly get ActionView::MissingTemplate exceptions, maybe some bot visits your site requesting silly formats like: http://www.rails-app.com/makandra.html-username-2000...
better_errors is an awesome gem for enhanced error pages in development, featuring a live-REPL for some light debugging...
Now you can say: class Song < ActiveRecord::Base attr_accessor :virtual_attribute assignable_values_for :virtual_attribute do
If you want to do JavaScript-style camelization, ActiveSupport's String#camelize method can actually help you out. Simply pass...
rake -W [substring_of_task]