Having trouble sending a post request

Edit: I have figured it out. I added a ! to create in my controller and sent params over as raw json in the body.

My question: I’m trying to send a post request to my api, adding in a title like I think I’m supposed to, but it was saving records without saving the title passed through in the params. After I added validations for the title, it doesn’t save the record at all, which is good I guess, means the validation is working. I’ve added screenshots of postman, the controller, the model, and the routes. I seriously have no idea what I’m doing wrong.

Details (like screenshots):
My postman request:

My controller:
Screen Shot 2021-07-30 at 8.31.01 AM

My model:
Screen Shot 2021-07-30 at 8.33.09 AM

How I found the problem: just trying to send a post request

I’ve already tried: adding an attr_accessor to the model, reformatting how I send the request (with quotes, with a + between words, with %20 between words), tried sending it through as raw json in the body of the request

1 Like