The following Haml will do: %head{ :profile => 'http://www.w3.org/2005/10/profile' } %link{ :href => image_path('favicon.ico'), :rel => 'icon', :type => 'image/vnd.microsoft.icon' }
If you want to exclude your staging site from Google using robots.txt without running the risk to forget deleting the...
There are two distinct ways of commenting Haml markup: HTML and Ruby. HTML comments This will create an HTML comment...
This is an awesome gadget in your toolbox, even if your test coverage is great. gem install ruby-debug (Ruby...
Our gem Mail Magnet allows you to override e-mail recipients in ActionMailer so all mails go to a given...
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...
If you added a file by mistake, you can unstage it (but keep local changes) by saying git reset HEAD...
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.
This might eventually be fixed by Rails itself.\ Right now this is the way to have the rails_xss plugin...
Sometimes you want to fetch associations for an ActiveRecord that you already loaded, e.g. when it has deeply nested associations...
There are three ways to define your own RSpec matchers, with increasing complexibility and options: 1) Use RSpec::Matchers.define
One option is to use partials. Or you can set the @template field to the name of another action:
Sometimes files attain executable-flags that they do not need, e.g. when your Windows VM copies them over a Samba...
When you need to add a event listener to hundreds of elements, this might slow down the browser. An alternative...
You may omit the /path/to/link_name to have a link with the same filename appear in the current directory
When deploying Rails applications you might have noticed that JS and CSS are not cached by all browsers.
With this plugin, you can create a scalable tooltip by just using a single background image for the tooltip body...
Prototip allows you to easily create both simple and complex tooltips using the Prototype javascript framework. Please note: "Permission to...
The point is, evented I/O is not magic scalability pixie dust, and like anything, there is a tradeoff.
A well-written API can be a great asset to the organization that wrote it and to all that use...
When working with times and dates in Rails applications, you need to deal with the following problem: In Rails, Time...