Building Better Web APIs with Rails
summary
Five concrete practices for APIs on Rails: keep routes expressive but route filtered endpoints to focused controllers instead of fat project controllers; serialize with jbuilder or ActiveModelSerializers (JSON:API) or Roar; push long work to background jobs and return ActiveJob perform_later with HTTP 202, not 200; use token auth via authenticate_or_request_with_http_token and SecureRandom.uuid for tokens; and cover status codes, mime types and auth with small integration tests (minitest) and curl checks.
AI-written summary · about
chapters (23)
- 0:00Introduction
- 1:46Scenario
- 5:22Routes
- 7:24Projects
- 12:06Content Negotiation
- 15:03JSON API
- 19:11Status Code
- 20:04Report Generation
- 21:28Active Job
- 22:55Status
- 23:38Authentication
- 24:46API Token
- 26:00Token Authentication
- 26:57UUID
- 27:57ActiveRecordCallback
- 30:40Semantic Versioning
- 31:15Versioning Services
- 34:08Removing Resources
- 36:14Integration Tests
- 36:29Listing Tests
- 38:29Authentication Access Rules
- 39:55Code School
- 40:30Podcasts








