This will show you how to create a RSS feed that the Feed Validator considers valid. Note that RSS is...
In modern Rails versions you can also use ActiveRecord's pluck method. User.active.pluck(:id) => [1, 5, 23, 42]
If you want to rename a key of a Ruby hash, this could help you out. Just put it into...
In july Google announced a new version of their image serach tool Google Images. But you won't find it...
First of all: You could just use RVM which would make the pain go away. If for some reason you...
You can use the whatlanguage gem to detect the language of a Ruby string. Note that it also has not...
Be careful! The following solution will delete files on a volume. If you don't know exactly what you're...
Physical servers worked, EC2 did not.
Cached fonts WILL caused an unstyled flash of text.
In a great post about named routes in Rails, path vs. url, Viget Labs ponders which variant is best used...
This post explains, in some detail, how we will implement a nice performance boost for Rails developers. Understanding the details...
WMD is a simple, lightweight HTML editor for blog comments, forum posts, and basic content management. You can add WMD...
Expiration of Rails sessions By default Rails sessions expire when the user closes her browser window. To change this edit...
When submitting textareas, browsers sometimes include carriage returns (\r) instead of just line feeds (\n) at the end of each...
If you iterate over a collection of arrays, you can destructure the arrays within the block parameters: movies_and_directors...
When a spec only runs when it is called directly, but not as part of the whole test suite, make...
Since RubyMine 3.1 you can drag tabs across panes/windows and out of the main window to create new windows.
Call with the server's hostname (and user if you have no SSH agent), e.g. install-gems-remotely my.server.com
There are two distinct ways of commenting Haml markup: HTML and Ruby. HTML comments This will create an HTML comment...
To return non-HTML responses (like XLS spreadsheets), we usually use the respond_to do |format| format.xls do # send spreadsheet...
There will probably be better solutions as we become more experienced with using Bundler, and more command line tools become...
def task_with_hoptoad_notification(options) task(options) do begin yield rescue Exception => e Airbrake.notify(e) raise e
Rails 3, 4, 5, 6 config/application.rb config/environment.rb before the initialize! call (we don't usually edit this file)
Update RubyGems and Passenger Bundler requires Rubygems >= 1.3.6. Run gem update --system if you have an older version.