Skip to content

Instantly share code, notes, and snippets.

@Szeliga
Created September 1, 2012 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Szeliga/3589123 to your computer and use it in GitHub Desktop.
Save Szeliga/3589123 to your computer and use it in GitHub Desktop.
def index
if stale?(:last_modified => @clients.maximum("updated_at"), :etag => @clients)
respond_with @clients.as_json(:methods => [:emails_count, :phones_count, :communications_count])
end
end
def show
if stale?(@client)
respond_with @client.to_json(:include => {
:emails => {:limit => 10},
:phones => {:limit => 10},
:user => {},
:communications => {:include => :clients}
})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment