mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-08-12 18:10:43 +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
6 lines
104 B
Ruby
6 lines
104 B
Ruby
json.cache! user do
|
|
json.(user, :id, :name, :role)
|
|
|
|
json.avatar_url fresh_user_avatar_url(user)
|
|
end
|