Plugins - RESTful XHTML

StarAdd to favorites

RESTful XHTML adds another content-type to Rails' respond_to behaviour, allowing you to respond to it like you would any other. By default, Rails treats XHTML and HTML the same, but if you're pedantic about your XHTML (and you should be :) you probably want to use the correct type for it.

Tore Darell

http://piano.altipla.no/pages/restful_xhtml

http://nimrod.interinter.net/plugins/trunk/restful_xhtml

Rails' (MIT)

  • Currently 3.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Controllers

Tags

Comments

Add a comment
Tore Darell 9 May 2007

@Will: Thanks for pointing this out. I've never used IE7 myself.

This is entirely IE7's own fault, though. Rails does the right thing and parses the Accept header and sorts the types according to the q numbers, but if IE7 can't tell us what it wants it gets whatever we have in stock right then. You can solve it by giving HTML priority over XHTML, see here:

http://piano.altipla.no/pages/internetexplorer7

Will 21 Apr 2007

This plugin does not work as expected. It responds with an "application/xhtml+xml" content-type header for IE 7, even though IE 7 does not send the content-type in its accept header. The plugin (or Rails?) really should check the accept request header before sending a response. So, XHTML should be sent as text/html to IE (for the time being). Or, at the very least, if the browser doesn't "accept" application/xhtml+xml, don't send it that.

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?