Created
May 4, 2012 14:06
-
-
Save ruprict/2594991 to your computer and use it in GitHub Desktop.
Rails HEAD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -I http://localhost:3000/posts.json\?per_page\=20\&page\=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10:00:32 web.1 | cache: [HEAD /posts.json?per_page=20&page=1] miss | |
10:00:32 web.1 | | |
10:00:32 web.1 | | |
10:00:32 web.1 | Started GET "/posts.json?per_page=20&page=1" for 127.0.0.1 at 2012-05-04 10:00:30 -0400 | |
10:00:32 web.1 | Processing by V2::PostsController#index as JSON | |
10:00:32 web.1 | Parameters: {"per_page"=>"20", "page"=>"1", "event_id"=>"18545"} | |
10:00:32 web.1 | | |
10:00:32 web.1 | test: GET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index | |
Rails.logger.info "test: #{request.method}" # This will return GET | |
if head? # This will return FALSE | |
...do head stuff | |
else | |
... do get stuff | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources :posts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment