instance method
template_format
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v2.3.18Signature
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 187
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 187
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Request