method
head
v5.0.0.1 -
Show latest stable
-
0 notes -
Class: ActionController::Head
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0 (0)
- 3.0.9 (-10)
- 3.1.0 (0)
- 3.2.1 (18)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (-3)
- 4.1.8 (0)
- 4.2.1 (38)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (1)
- 7.1.3.4 (0)
- What's this?
head(status, options = {})
public
Returns a response that has no content (merely headers). The options argument is interpreted to be a hash of header names and values. This allows you to easily return a response that consists only of significant headers:
head :created, location: person_path(@person) head :created, location: @person
It can also be used to return exceptional conditions:
return head(:method_not_allowed) unless request.post? return head(:bad_request) unless valid_request? render
See Rack::Utils::SYMBOL_TO_STATUS_CODE for a full list of valid status symbols.