I want the JSON file to correspond to the model one-on-one.

Asked 2 years ago, Updated 2 years ago, 90 views

For example, when the Reservation model is created, I would like to create a corresponding JSON file.

I think I should add the json column to the Reservation model and store the path to the json file, but I don't know how to create the json file.

Thank you for your cooperation.

ruby-on-rails json

2022-09-30 18:35

1 Answers

Where are you going to save the files you created? I don't think it makes sense to save them on the server where the rails are running.

Your choice is:

  • If mysql 5.7+ or postgress, save json in reservation because json type columns are available. If json type is not available, create a text type column and save it there.
  • Upload to aws3 etc

I think there is.


2022-09-30 18:35

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.