Skip to content

Instantly share code, notes, and snippets.

@Electron-libre
Created July 25, 2013 10:41
Show Gist options
  • Save Electron-libre/6078612 to your computer and use it in GitHub Desktop.
Save Electron-libre/6078612 to your computer and use it in GitHub Desktop.
HEAD request in Rails , used to send collection informations ...
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