Different view for desktop and mobile browser

Hi,
I am just beginning with RoR and I need to add into existing RoR
application version for mobile device-concretely iPhone. I need to
change layer for it and a lot of view because I need different display
on the iPhone. So I am thinking about three ways how to do it:

  1. change a url address to domain/iphone/…
    -here i suppose i need to change routes for each of my new sites,
    probably new controllers etc. (i don’t know exacly) - this way seems to
    me like creating almost whole application again

  2. add an attribute to the url like type=iphone and in controllers if is
    this type iphone render view for iphone

  3. use session with same result like in point 2

Or is here some better way how to do it???
Thank you very much for every help.
Pavel

I would say no to all of those options.

Look here for a better way:
http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2

On Jan 26, 12:17 pm, Pavel H. [email protected]

brewpoo wrote:

I would say no to all of those options.

Look here for a better way:
http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2

On Jan 26, 12:17 pm, Pavel H. [email protected]

It looks good, thank you

Apple’s iPhone dev page.
http://developer.apple.com/iphone/devcenter/designingcontent.html

I have a site that has an iPhone layout but I just add a style on top
of what I already developed. But I wanted the site to be mobile
friendly from the start. On the ‘PC’ it’s very sparse.
(self promotion)
http://www.cpord.com/
http://www.cpord.com/signup
It’s in alpha. It’s another GTD(to-do list) app.
It’s not flashy and chopped full of Ajax yet. I’ll be adding that
later. Like I said, I’m aiming for mobile devices.
(comments welcomed.)

i guess my point is you don’t really need to go to a subdomain for the
iPhone, unless you want to send less data or diffeent functions to the
iPhone.

my two cents. . .

John.

On Jan 26, 1:40 pm, Pavel H. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs