# Blackberry & handhelds

**URL:** <https://www.ruby-forum.com/t/blackberry-handhelds/165332>\
**Category:** Rails\
**Created:** [April 12, 2009, 3:40pm UTC](https://www.ruby-forum.com/t/blackberry-handhelds/165332 "2009-04-12T15:40:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JannaB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Post date:** [April 12, 2009, 3:40pm UTC](https://www.ruby-forum.com/t/blackberry-handhelds/165332/1 "2009-04-12T15:40:03Z")

</div>

I notice when I go to a site like [schwab.com](http://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

---

<div class="post-metadata">

**Author:** ![JannaB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Post date:** [April 12, 2009, 3:47pm UTC](https://www.ruby-forum.com/t/blackberry-handhelds/165332/2 "2009-04-12T15:47:05Z")

</div>

On Apr 12, 1:29 pm, JannaB [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I notice when I go to a site like [schwab.com](http://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](http://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/](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

---

<div class="post-metadata">

**Author:** ![JannaB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Post date:** [April 12, 2009, 5:46pm UTC](https://www.ruby-forum.com/t/blackberry-handhelds/165332/3 "2009-04-12T17:46:58Z")

</div>

On Sun, Apr 12, 2009 at 6:46 AM, Frederick C.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Along side your html.erb template you’d have a  
> phone.erb template with dumbed down content/presentation/etc.

A minor quibble: translating a data-rich application from a full-size  
computer screen to be usable and useful on a tiny screen shouldn’t  
be thought of as “dumbing down” – it’s refactoring that application’s  
information architecture/presentation to better address the needs of  
the mobile user.

Sometimes more easily accomplished than others. 🙂

## FWIW!

Hassan S. ------------------------ removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![JannaB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Post date:** [April 13, 2009, 2:31am UTC](https://www.ruby-forum.com/t/blackberry-handhelds/165332/4 "2009-04-13T02:31:50Z")

</div>

Yes and it appears Rails may be particularly good at doing exactly  
the! Thank you both for your postings. -Janna

On Apr 12, 11:45 am, Hassan S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
