* Duncan Mac-Vicar P <[email protected]> [Aug 25. 2009 00:04]:
> ref: refs/heads/master
> commit 72faf37c3f8dda4ab91a97f677f8833a775bded8
> Author: Duncan Mac-Vicar P <[email protected]>
> Date:   Tue Aug 25 00:01:33 2009 +0200
> 
>     Use format instead of content type, as it seems to set the
>     content type too.

Hmm, this looks 'fishy' to me. Actually, both ways (@request.accept
and setting :format) should work. The (http-wise and restful) correct way is
setting the http 'accept' header to the list of mime types (yes, there
can be multiple) acceptable by the client. The server is then free to
choose one of them.

The :format is a Rails extension to support setting the mime type
via the URL. Just look at the default routes.rb entry:

  map.connect ':controller/:action/:id.:format'

This is basically a regexp saying that if the url contains two slashes
and a dot its to be parsed as controller-slash-action-slash-id-dot-format

Summary: Honoring the accept header is a 'must', honoring the :format
extension a 'can'.

Hth,

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to