Hi, I''m working on rails project where I use json file for storing some data. 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 cache issue? 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 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Sat, Aug 4, 2012 at 2:29 PM, aldm alert <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> > 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 > cache issue? > >What does your log says? can you put here some of it for each browser? Javier Q -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Hi, thanks for reply. I will put log tomorrow from my office. It is userful to say that before this json files was in assets folder and everything worked fine. Then i delete files from assets and put it in public folder and of course chnaged application top get files from public folder not from assets. And then this problem begin to happens -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
And it works fine on localhost it just make problems on production server -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.