Bholzer
Bholzer

Reputation: 189

Making Rails application work with iPhone

At work we have an web application that was not built to support smartphones. Now, we have a need to offer a couple of simple features that can be accessed from a smartphone. My question is this: is it possible to detect a user-agent for a smartphone and serve different template files and/or layout for that agent?

We don't have the time/manpower to write an iPhone app, but if I can make the web version compatible with an iPhone resolution in a couple nights I can do that.

Upvotes: 0

Views: 88

Answers (3)

99miles
99miles

Reputation: 11222

There's mobvious which I use and like:

https://github.com/jistr/mobvious

You can then put device-type specific layouts under their own subdirectories when you want to override the other, for example views/mobile/users/index.html.erb

but a quick Google search shows many other options such as:

http://detectmobilebrowsers.com/

Upvotes: 0

sameera207
sameera207

Reputation: 16629

I think following would help you

1) Make your layout mobile compatible with something like twitter bootstrap, Following is the gem for rails

2) Detect the request agent and server the pages accordingly, railscasts

3) This is a gem (mobile_fu) which will help you, but seems like this bit outdated

HTH

Upvotes: 1

t56k
t56k

Reputation: 6981

You just need iPhone-specific CSS files.

Upvotes: 1

Related Questions