June 11, 2006

Posted by John

Older: Plugin: Manage Fixtures

Newer: Hash Goodness

Parameter Driven Response-Type Determination

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.

0 Comments

Thoughts? Do Tell...


textile enabled, preview above, please be nice
use <pre><code class="ruby"></code></pre> for code blocks

About

Authored by John Nunemaker (Noo-neh-maker), a programmer who has fallen deeply in love with Ruby. Learn More.

Projects

Flipper
Release your software more often with fewer problems.
Flip your features.