Re: rendering different html for mobile devices

Frederick Cheung
2009-03-05T11:09:43Z

On Mar 5, 10:50 am, bingo bob
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
> Sorry if this is a bit OT - but I know people here like to help out!
> Be grateful for any advice.
>
> I''d like to render an html page but two versions.
>
> - One version for mobile devices (iphones and blackberries specifically)
> - One version for everything else
>

You can create ''fake'' mime types for this. In a before filter
you can
then set the format of the request based on the user agent. Then
instead of just having a foo.html.erb you have a foo.smartphone.erb
and foo.dumbphone.erb.

Fred
> Any pointers appreciated.
>
> I''d like to do this with divs on the page for each section of
content
> and show either depending on the viewing device.
>
> Questions
> ---------
>
> - Would this approach work?
> - How do I do it?
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---