Johnathan R. Nunes

Joined

120 Experience
1 Lesson Completed
0 Questions Solved

Activity

Posted in File uploads in Rails with Shrine Discussion

Ok, I changed PG column to json and now it works. Some tutorials I read stated to use string and not json but it works fine, so I guess that's it.

Posted in File uploads in Rails with Shrine Discussion

Guys, I'm trying to get shrine to work with my rails api but I can't figure out what I'm messing.

I'm able to upload the file but the image_data that is return doesn't go to my image_data column. It gives me a JSON Parse error 783. What I'm supposed to do? Store the image_data as a string (eg. "{\"id\":\"89966472375f0c62dd2f8404da931d84.jpg\",\"storage\":\"cache\",\"metadata\"...) or what?

I'm using a SPA as front-end. The problem is when I try to use the uploaded file into the model that have the atacched file metadata.