rails/rails — Issue #3855: Format fallback
Author: Dorian
Created: 2011-12-05 00:49:47+00:00
State: open

### The situation

I have html views, like `index.html.erb`, and it is the normal view of my website.
I also have mobile views (`format = :mobile`), like `index.mobile.erb`.
`format = :mobile` is automaticaly set when a mobile device watch my website

### The issue

When an user see `posts#show` from his mobile, I did not write a mobile view for this action, so he have an error.
Instead, he should see the mobile layout (`layouts/application.mobile.erb`) with the `posts/show.html.erb` in it.

### How to resolve this

I don't know a lot about Rails source code, but people from StackOverflow tried to solve this issue [with hacks](http://stackoverflow.com/questions/4062518/can-a-mobile-mime-type-fall-back-to-html-in-rails) of **ActionView::FileSystemResolver** and **ActionView::PathResolver classes**, there are some possibles solutions, but I don't understand them quite well so I will not integrate it in my website.

Please, people of the rails community, can somenone solve this ?