instance method
variant
Ruby on Rails 8.1.2
Since v5.2.8.1Signature
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 159
def variant
@variant ||= ActiveSupport::ArrayInquirer.new
end
Defined in actionpack/lib/action_dispatch/http/mime_negotiation.rb line 159
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Http::MimeNegotiation