I'm working on rails project where I use json file for storing some
Basically data are stored and get using ajax calls from jquery.
But there are some strange issues.
For example, when I add data in json file using AJAX and then open file
in Chrome: localhost:3000/example.json there are no data. I open the
file in firefox and data exists. When i refresh file in Chrome there are
data. Sometimes data is inserted correctly. Maybe it could be browser
I know that AJAX is asynchronous but sometimes there are few refreshes
needed for data to be added- JSON file is in public folder and I'm
adding data from rails controller like this is txt file. I just convert
hash to json and insert json in file like it's txt file.
What can be problem here?
How can I make inserting and reading data in json file works correctly?
If I'm not clear, I can exaplain this better, just say.
I appreciate any kind of help