June 11th, 2006

So edge rails has some severe new sweetness. DHH announced a while ago that Rails 1.1 would respond to the HTTP-accept header thus allowing each action to respond differently based on what was being requested. Changeset 4384 adds on to that feature by making it possible to change the accept type by passing a parameter named format in the url.

For example, http://www.domain.com/action would return html. However, if you changed that request to http://www.domain.com/action?format=xml, Rails now overrides the default text/html accept header that the browser sends and responds with xml. Check out the changeset for more information.

Posted by jnunemaker in Core

Sorry, comments are closed for this article to ease the burden of pruning spam. If you have any further comments, just send me an email.

About

Rails Tips is run by John Nunemaker, a web developer/programmer who has fallen deeply in love with Ruby.

Syndication

RailsTips Articles - An assortment of news and howto's related to ruby and rails.

Rails Quick Tips - These are cool Rails related links that I find. Typically, less than 5 a day.

Search