Topic: XHTML and Rails


I'm trying to display my website on xhtml. I've in my application view this

<?xml version="1.0" encoding="UTF-8"?>
"-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en" lang="en">
<meta http-equiv="content-type" content="application/ce-html+xml; charset=UTF-8"/>

but my browser is still thinking that it's a html file because of the extention.

In fact, if I try my simple file in a browser with the xhtml extension it works but not with the html extension.

So what can I do to configure rails now?


Re: XHTML and Rails

What exactly are you trying to accomplish?

The browser is supposed to only interpret *HTML and JavaScript using the .html or .htm file extensions. You must use .erb, or .rhtml. Just like with PHP, you use .php, .php3, .php4, .php5, .phtml, etc...

And really, outside of the scope of client side languages, the server interprets everything. So when you are writing your pages, and you give the .erb or .rhtml extensions, you're telling that web server to intrepret this Ruby code through MIME types configured through the server.

All you have above is just the standard W3C XHTML Transitional DTD, so there's nothing to do with that anyway, it's just there. There's not even any <head>, or <body> tags there....