RequestJS

Episode #544 by Teacher's Avatar David Kimura

Summary

In this episode, we'll have a look at a few different examples of how to make AJAX requests in a modern Rails application. We'll also explore some of the different things to be aware of and patterns that I feel make for maintainable applications.
rails ajax stimulusjs 34:51

Chapters

  • Introduction (0:00)
  • Setting up the example (2:43)
  • Adding request.js (7:36)
  • External API Request (8:17)
  • Internal API (GET) (19:29)
  • Proper use cases (21:48)
  • Internal API (POST) (23:37)
  • Internal API (PATCH) (30:06)
  • Final Thoughts (32:52)
  • CSRF Token (33:57)
Student & Teacher
$ 9 /mo

Valid School Email Required

Same Access as Pro

Subscribe Now
Pro Monthly
$ 19 /mo

Access to Pro Episodes

Invite to Slack Channel

Priority Suggestions

Ad Free

Subscribe Now
Pro Annual
$ 190 /yr

Access to Pro Episodes

Invite to Slack Channel

Priority Suggestions

Ad Free

Subscribe Now
Teams
$ 57 /mo

3 Users Minimum

$19.00 / user / month

Same Access as Pro

Subscribe to Teams