format=(extension)
Instance Public methods
Sets the format by string extension, which can be used to force custom formats that are not controlled by the extension.
1 2 3 4 5 6 7 8 | class ApplicationController < ActionController::Base before_action :adjust_format_for_iphone private def adjust_format_for_iphone request.format = :iphone if request.env[ "HTTP_USER_AGENT" ][/iPhone/] end end |
Please login to continue.