mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-08-12 10:00:42 +09:00
80c9e7fbfe
- Use jbuilder instead of hashes
- Use resource instead of direct HTTP verbs
Verbs only make sense if you have one or two routes, if there are
multiple that emulate what resource does then it's better to use resource.
- Paginate using link headers
- Cache responses
13 lines
202 B
Ruby
13 lines
202 B
Ruby
module RawRequestBody
|
|
extend ActiveSupport::Concern
|
|
|
|
private
|
|
|
|
def raw_request_body
|
|
request.body.rewind
|
|
request.body.read.force_encoding("UTF-8")
|
|
ensure
|
|
request.body.rewind
|
|
end
|
|
end
|