A simple way to build iPhone specific interface with Rails
- class ApplicationController < ActionController::Base
- exempt_from_layout('iphone_html.erb')
-
- before_filter :check_iphone
-
- protected
- def iphone?
- request.user_agent.include?('iPhone')
- end
-
- def check_iphone
- if iphone?
- request.parameters[:format] = 'iphone_html'
- end
- end
- end
-
- class DashboardController < ApplicationController
- def index
- @top_movies = Movie.top_movies
- @movie = @top_movies.first
-
- respond_to do |format|
- format.html
- format.iphone_html
- end
- end
- end
huh nice,
ReplyDeleteonly what we need is to have iphone in israel :)
400$ on ebay, unlocked for any gsm
What you really want to check for here is mobile safari, not the iPhone as such. Mobile safari is used on both the iPhone and the iPod touch.
ReplyDeleteDetails are here.
We all know Apple iPhone is very rich in multimedia features including Internet capabilities... and of course the price isn't affordable to the average people...
ReplyDeleteSo if you own this Gadget I think it's better to have an extra care specially the screen, it needs Incase iPhone Slider Case to protect your iPhone from unwanted scratch.
This is only an advice... don't think it seriously if you don't want.
Peace!
That's right.
ReplyDeletei don't really think it's too expensive, but still, it is one of the best things i purchased.