XHTML Content Type plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install http://svn.codahale.com/xhtml_content_type/
xhtml_content_type is super easy to use. Add the method +sends_xhtml_with_correct_content_type+ to a specific controller, or to ApplicationController to make all controllers send XHTML properly:
class ApplicationController < ActionController::Base sends_xhtml_with_correct_content_type end
+sends_xhtml_with_correct_content_type+ also accepts standard filter-style conditions, if you need them:
class MySpecialController < ApplicationController sends_xhtml_with_correct_content_type :except => [:seriously_weird_action] end class MyOtherSpecialController < ApplicationController sends_xhtml_with_correct_content_type :only => [:the_only_regular_action] end
You can also explicitly specify an XHTML content type using this plugin:
def xhtml_only_action render :content_type => :xhtml end
If you're declaring the content type in a element as well, you should do something like this:
< meta http-equiv="content-type" content="<%= controller.preferred_content_type %>; charset=UTF-8" />
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, about 1 year ago

