instance method query

Ruby on Rails edge

Since edge

Signature

query(*path_or_actions, as: DEFAULT, to: nil, controller: nil, action: nil, on: nil, defaults: nil, constraints: nil, anchor: nil, format: nil, path: nil, internal: nil, **mapping, &block)

Define a route that only recognizes HTTP QUERY. QUERY is a safe and idempotent method for queries with a request body, defined in RFC 10008: The HTTP QUERY Method. For supported arguments, see match

query 'bacon', to: 'food#bacon'

Parameters

path_or_actions rest
as key = DEFAULT
to key = nil
controller key = nil
action key = nil
on key = nil
defaults key = nil
constraints key = nil
anchor key = nil
format key = nil
path key = nil
internal key = nil
mapping keyrest
block block
Source
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 860
        def query(*path_or_actions, as: DEFAULT, to: nil, controller: nil, action: nil, on: nil, defaults: nil, constraints: nil, anchor: nil, format: nil, path: nil, internal: nil, **mapping, &block)
          match(*path_or_actions, as:, to:, controller:, action:, on:, defaults:, constraints:, anchor:, format:, path:, internal:, **mapping, via: :query, &block)
          self
        end

Defined in actionpack/lib/action_dispatch/routing/mapper.rb line 860 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionDispatch::Routing::Mapper::HttpHelpers

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close