Fallback to another existing MIME type when the required is missing in Rails

Posted by fifigyuri on Stack Overflow See other posts from Stack Overflow or by fifigyuri
Published on 2010-06-16T12:38:47Z Indexed on 2010/06/16 13:02 UTC
Read the original article Hit count: 210

Filed under:
|

I want to extend the existing supported HTML type of my site by support for iPhone. For this I registered a new MIME type. I created a layout for iphone and also converted some of the html views to iphone version. However, I did not convert all of the html.erb files. I do not see the reason to convert all views, some of them should not change, some partials simply just remain the same.

I guess there should be a solution for this case. I tried to search for ways how to fallback to an existing format, but did not find any answer. Does a way to define fallback for MIME types in Rails exist? How does it work? If it doesn't exist and thus I wanted to solve the issue not the right way, what could simply solve the task of extending an existing site by another format?

Thanks for your suggestions.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about mime-type