![](https://seccdn.libravatar.org/avatar/d18d0fd84170a8255c30388a800b96c8.jpg?s=120&d=mm&r=g)
* Duncan Mac-Vicar P <dmacvicar@suse.de> [Aug 25. 2009 00:04]:
ref: refs/heads/master commit 72faf37c3f8dda4ab91a97f677f8833a775bded8 Author: Duncan Mac-Vicar P <dmacvicar@suse.de> 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: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org