On Apr 12, 1:29 pm, JannaB <[email protected]> wrote:
> I notice when I go to a site like schwab.com, they have their full
> format page come up when I log on via a computer. However, if I log on
> via my blackberry, it;s dramatically stripped down.
>
> I realise much of this is done by my blackberry - the disregarding of
> graphics, not paying attention to tables, etc. But is there a way to
> discern if someone is logging in via a handheld device as opposed to a
> computer, and route to a more appropriate view? Thanks, Janna

One way is work exactly as usual but be careful that your css etc.
degrades gracefully.

Another involves creainge a fake format (eg :phone) and set the format
to that in a before filter if the user agent matches something
relevant or if the user has gone to a relevant subdomain (eg
mobile.foo.co). Along side your html.erb template you'd have a
phone.erb template with dumbed down content/presentation/etc. Rails
will pick that template automatically when appropriate and of course
you get to use respond_to (see
http://www.slashdotdash.net/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2/
for an example of this).

Fred



--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to