I am facing a problem in production server. This is duplicate of another questions but all that questions-answers didn't work for me.
I used 'delete' method for 'link_to' tag:-
<%= link_to "Delete Campaign", campaign_path(campaign), :class => "btn btn-danger", :method => :delete, :confirm => 'Are you sure?'%>
When I click on "Delete Campaign" link, I am getting confirmation pop-up twice. This is happening on client's production environment only.
Using Ruby 1.9.2 and Rails 3.2.13.
In my gemfile, I used:-
gem 'jquery-rails'
In my application.js:-
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require bootstrap-timepicker
//= require_tree ../../../vendor/assets/javascripts/
In my application.html.erb:-
<%= javascript_include_tag "application" %>
<%= javascript_include_tag "http://code.jquery.com/ui/1.10.2/jquery-ui.js" %>
When I searched about it, I found:-
1. config.assets.debug should be false in production.rb (It is false but not working)
2. There should be no public/assets directory (No such directory in app)
3. Run rake assets:clean on production (no effects)
4. These two line should be removed from application.js:-
//= require jquery
//= require jquery_ujs
Last one worked for me but after removing these lines, whole application been affected and all jquery event stopped working.
According to my knowledge either jquery is loading twice(but not more than one javascript_include_tag used) or there is a problem in "config.assets.compile" which is true in production.rb
I can't check it on my local and heroku too as it is working fine for both.
List of file in my vendor/assets/javascripts :-
- bootstrap.js
- bootstrap-datepicker.js
- chai.js
- jquery-cookie.js
- mocha.js
- moment.js
- require.min.js
- text.js
- underscore-amd.js