method
variant
v8.1.1 -
Show latest stable
- Class:
ActionDispatch::Http::MimeNegotiation
variant()public
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