Question

Rails 4 app is creating duplicate MySQL entries

Posted March 28, 2014 2.7k views
I have a Rails 4 app running on the one-click Ruby on Rails instance. I followed this tutorial: https://www.digitalocean.com/community/articles/how-to-launch-your-ruby-on-rails-app-with-the-digitalocean-one-click-image Everything is working perfectly, except for one strange issue. Every time I create a new entry in my rails app through any sort of "create" action, two entries are added to the database. For example, the standard Rails scaffolding for creating a post will create two posts in the MySQL db instead of one. Has anyone experienced this before? I should add that this is not happening in development. It's only when I push the app to the server and run in production.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer
Are you still running in "development" mode on the server? Do you have precompiled assets in "public/assets"? Those things combined could be causing your issue:

http://stackoverflow.com/questions/7721502/rails-3-1-remote-requests-submitting-twice

Let us know if you're still having a problem.
Submit an Answer