instance method
template_format
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.2.3Signature
template_format()
Returns a symbolized version of the :format parameter of the request. If no \format is given it returns :jsfor Ajax requests and :html otherwise.
Source
# File actionpack/lib/action_controller/request.rb, line 177
def template_format
parameter_format = parameters[:format]
if parameter_format
parameter_format
elsif xhr?
:js
else
:html
end
end
Defined in actionpack/lib/action_controller/request.rb line 177
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::AbstractRequest