The Artima Developer Community
Sponsored Link

Java Buzz Forum
Rails 2.0 and the iPhone

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
Rails 2.0 and the iPhone Posted: Oct 1, 2007 8:49 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: Rails 2.0 and the iPhone
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement

Rails is making it simpler to implement an iPhone specific site using a fake mime-type:

  # should go in config/initializers/mime_types.rb
  Mime.register_alias "text/html", :iphone

class ApplicationController < ActionController::Base
before_filter :adjust_format_for_iphone

private
def adjust_format_for_iphone
if request.env["HTTP_USER_AGENT"] && request.env["HTTP_USER_AGENT"][/(iPhone|iPod)/]
request.format = :iphone
end
end
end

class PostsController < ApplicationController
def index
respond_to do |format|
format.html # renders index.html.erb
format.iphone # renders index.iphone.erb
end
end
end

There are plenty of other nice RESTie features too.

Read: Rails 2.0 and the iPhone

Topic: Nokia has posted the finished spec of JSR 264, Order Management API, to the Java Community Process. Previous Topic   Next Topic Topic: links for 2007-09-24 from PeopleOverProcess.com

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use