How to create a blog in Ruby on Rails API part 2 - creating, updating, and deleting

Now that you have a model and can display out the blog posts, we want to be able to create, update, and delete more posts. But what about making sure the post is only editable by the proper user? And what format do we want to send them to our frontends in via our API? In this episode, we'll create API endpoints for create, update, and delete, and then explore the Pundit Gem and the jsonapi-serializer Gem based on
🤯 Support on Patreon

⏱️ Timestamps:
  • 00:00 - Introduction
  • 00:50 - Test coverage results
  • 01:20 - Gemfile
  • 02:05 - JSON API Serializer and spec
  • 03:45 - Pundit Gem
  • 04:15 - posts controller and logic changes for create, update and delete
  • 10:45 - adding Pundit / how pundit works
  • 18:45 - adding specs to test access

💌 Newsletter:

  • Twitter:
  • Twitter:
  • GitHub:

  • Create, update and delete API endpoints for our Blog Post model


🎬 Subscribe!

My name is David W Parker and I’m creating and publishing videos on ProgrammingTIL to help teach anyone and everyone who wants to code. I’m a huge fan of Ruby on Rails, Svelte, TailwindCSS, and WebGL. I’ve used React a lot in the past, as well as some Vue and AngularJS. I’ve done some professional Python and Django. I like to create real applications and my tutorials will walk you through how to build something real from beginning-to-end.

ruby #rails #rubyonrails