I'm having a bit of trouble getting my javascript function that is compiled by the Asset Pipeline to work in production. It is working fine in development.
Javascript
# app/assets/javascript/subscribe.js
$(function() {
$('#fat-btn').click(function() {
var btn = $(this)
btn.button('loading')
setTimeout(function () {
btn.button('reset')
}, 2000)
});
});
My view
# app/assets/subscribe.html.erb
<div class="subscribe">
<%= form_tag subscribe_path, class: "form-inline" do %>
<%= text_field_tag :email, nil, :type=>"email", :placeholder => 'Your email address' %>
<%= button_tag "Go", id: "fat-btn", class: "btn", data: { "loading-text" => "loading...", "toggle" => "button"} %>
<% end %>
</div>
My Application Javascript
# app/assets/javascript/application.js
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require_tree .
Any help is much appreciated it. Thank you