instance method
variant
Ruby on Rails edge
Since v5.0.7.2Signature
variant()
Returns the \variant for the response template as an instance of ActiveSupport::ArrayInquirer.
request.variant = :phone
request.variant.phone? # => true
request.variant.tablet? # => false
request.variant = [:phone, :tablet]
request.variant.phone? # => true
request.variant.desktop? # => false
request.variant.any?(:phone, :desktop) # => true
request.variant.any?(:desktop, :watch) # => false
Source
# File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 161
def variant
@variant ||= ActiveSupport::ArrayInquirer.new
end
Defined in actionpack/lib/action_dispatch/http/mime_negotiation.rb line 161
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Http::MimeNegotiation