instance method attempt

Ruby on Rails edge

Since v6.1.7.10

Available in: v6.1.7.10 v7.0.10 v7.1.6 v7.2.4 v8.0.5.1 v8.1.4 edge

Signature

attempt(env)

No documentation comment.

Parameters

env req
Source
# File actionpack/lib/action_dispatch/middleware/static.rb, line 72
    def attempt(env)
      request_method = env[::Rack::REQUEST_METHOD]

      if request_method == "GET" || request_method == "HEAD"
        if found = find_file(env[::Rack::PATH_INFO], env)
          serve Rack::Request.new(env), *found
        end
      end
    end

Defined in actionpack/lib/action_dispatch/middleware/static.rb line 72 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionDispatch::FileHandler

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