Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Browser Filters

Browser Filters

Browser filters is a collection of three common filtering needs:

  • UnicodeContentType: Set the charset to text/html; charset=utf-8 unless something else has already been specified by the action.
  • SafariUnicodeFix: Fix the unicode sent to the Safari browser under Ajax calls to prevent garbage.
  • LinkPrefetchingBlock: Block all pre-fetching requests by the Google Web Accelerator and others using a 403 Forbidden.

You can get all these filters applied at once by simply including BrowserFilters:

class ApplicationController < ActiveRecord::Base
  include BrowserFilters
end

...but you can also cherry-pick:

class ApplicationController < ActiveRecord::Base
  include SafariUnicodeFix, LinkPrefetchingBlock
end

Copyright© 2005 David Heinemeier Hansson, Thomas Fuchs, released under the MIT license

NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly