My javascript works in local environment but not on Heroku.
The file is "destroy.js.erb" and it is located in view, same as index.html.erb (where javascript is used).
Here are the Heroku logs that I suspect where the error occurred:
2014-01-07T03:34:31.980578+00:00 app[web.1]:
2014-01-07T03:34:31.980578+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/assets/application-ed404d2f6b226ecfcf36b0b53bc646a7.js"):
2014-01-07T03:34:31.980578+00:00 app[web.1]: I, [2014-01-07T03:34:31.976356 #2] INFO -- : Started GET "/assets/application-ed404d2f6b226ecfcf36b0b53bc646a7.js" for 24.24.157.128 at 2014-01-07 03:34:31 +0000
2014-01-07T03:34:31.980578+00:00 app[web.1]: F, [2014-01-07T03:34:31.977454 #2] FATAL -- :
2014-01-07T03:34:31.980578+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
destroy.js.erb: (JavaScript is called delete user via fadeOut instead of page refresh)
$('#<%= dom_id(@user) %>').fadeOut();
index.html.erb:
<h3>All Users List</h3>
<head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> </head>
<% @users.each do |user| %>
<%= div_for user do %>
<%= link_to "User #{user.firstname} #{user.lastname}", user %>
<font color='green'><%= user.email %></font>
<div class="actions">
<td><%= link_to 'View Detail', user %></td>
<td><%= link_to 'Edit', edit_user_path(user) %></td>
<td><%= link_to 'Delete User', user_path(user), method: :delete, remote: true, data: {confirm: 'Are you sure?'} %></td>
<p>
</div>
<% end %>
<% end %>
<%= link_to 'Create New User', new_user_path %>
layouts/application.html.erb:
<!DOCTYPE html>
<html>
<head>
<title>Crud</title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>
EDIT: Here is the app: http://sheltered-sea-8479.herokuapp.com/users
Does anyone know how to resolve this issue?
Thank you!
application.js? I suspect it's not, and that may point you towards the right direction.