Else case in respond_to


#1

Has anybody found out how to deal with unknown respond_to’s?

for example:

 respond_to do |format|
   format.html # show.rhtml
   format.xml { head :status => :method_not_allowed }
   format.rss { head :status => :method_not_allowed }
   format.atom { head :status => :method_not_allowed }

will deal well with predetermined types (html, xml, rss, atom)

but I’d like to respond appropriately to say ‘format.jpg’.

any thoughts?

Cheers,
Jodi
General Partner
The nNovation Group inc.
www.nnovation.ca/blog


#2

On 2/9/07, Jodi S. removed_email_address@domain.invalid wrote:

will deal well with predetermined types (html, xml, rss, atom)

but I’d like to respond appropriately to say ‘format.jpg’.

any thoughts?

Create your own mime types. Topfunky shows you how –
http://nubyonrails.com/articles/2006/12/18/dynamic-graphics-with-rails-1-2


Rick O.
http://weblog.techno-weenie.net
http://mephistoblog.com


#3

On 9-Feb-07, at 3:02 PM, Rick O. wrote:

  format.rss { head :status => :method_not_allowed }

rails-1-2
Thanx Rick - but I’m trying to handled edge cases - mime types asked
for, but application doesn’ t handle. intentionally.

make sense?

J