[阅读: 370] 2008-03-12 08:46:25
# map.namespace(:admin) do |admin|
# admin.resources :products,
# :collection => { :inventory => :get },
# :member => { :duplicate => :post },
# :has_many => [ :tags, :images, :variants ]
# end
# 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