title: Jquery Removeclass rails not working
body: <p>Can someone help me in this? I want to remove a class on button click, but it works only after 1 click is already done. when i click first time, nothing happens. when i click second time, class is removed
  HTML Code</p>
  
  <pre><code>&lt;%= form_for :email_form, :html =&gt; {:class =&gt; "form-horizontal"}, url: search_reduce_credits_by1_path, id: "candidate-email-modal-form", remote: true do |f| %&gt;
  
      &lt;%= f.hidden_field :lead_id, :value =&gt; lead.id %&gt;
  
      &lt;div class=text-right&gt;
      &lt;%= f.button class: "btn btn-primary", id: "show-mail-btn" do %&gt; 
                                          Show Email
       &lt;% end %&gt;
       &lt;/div&gt;
  
       &lt;% end %&gt; 
  
      &lt;small class="blurfilter" id="blurred_email_&lt;%= lead.id %&gt;"&gt; &lt;%= lead.email %&gt;&lt;/small&gt;
  </code></pre>
  
  <p>JQuery:</p>
  
  <pre><code>$(document).ready(function (){
      $('#show-mail-btn').click(function (){
          $('#blurred_email_1').removeClass('blurfilter');
      });
  });
  </code></pre>
  
  <p>When I update jquery to this,</p>
  
  <pre><code>$(document).on('click', '#show-mail-btn', function(){
    alert("Hey");
    $('#blurred_email_1').removeClass('blurfilter');
  });
  </code></pre>
  
  <p>"Hey" also appears on second click and appears two times, before class is removed.</p>