Created
July 25, 2013 10:41
-
-
Save Electron-libre/6078612 to your computer and use it in GitHub Desktop.
HEAD request in Rails , used to send collection informations ...
This file contains hidden or 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
module ApiController | |
def index | |
# ... | |
# How | |
if request.head? | |
@count = self.class.resource_model.count(user_context, format_filters(@filters)).content | |
head :ok, "Content-Range" => "#{self.class.resource_model.name} #{@offset}-#{@limit}/#{@count}" | |
else | |
# .... | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment