Forum: Ruby on Rails else case in respond_to

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jodi S. (Guest)
on 2007-02-09 21:33
(Received via mailing list)
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
Rick O. (Guest)
on 2007-02-09 22:03
(Received via mailing list)
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...


--
Rick O.
http://weblog.techno-weenie.net
http://mephistoblog.com
Jodi S. (Guest)
on 2007-02-09 22:08
(Received via mailing list)
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
This topic is locked and can not be replied to.