Flowdock
method

format=

Importance_1
v2.0.0 - Show latest stable - 0 notes - Class: ActionController::AbstractRequest
format=(extension) public

Sets the format by string extension, which can be used to force custom formats that are not controlled by the extension. Example:

  class ApplicationController < ActionController::Base
    before_filter :adjust_format_for_iphone

    private
      def adjust_format_for_iphone
        request.format = :iphone if request.env["HTTP_USER_AGENT"][/iPhone/]
      end
  end
Show source
Register or log in to add new notes.