title: Modal Pop up window on Rails Controller Action
body: <p>In my customer index view if I click on delete customer button, the following actions take place in my Customers controller delete method.</p>
  
  <p><strong>Customers_controller.rb</strong></p>
  
  <p>class CustomersController &lt; ApplicationController
  .
  .</p>
  
  <pre><code>def destroy
      if Customerarticle.where(author_id: params[:id]).count &gt; 0
        #####I need the logic here to display a modal window on my index page of customers here#####
      else
        Customer.find(params[:id]).destroy
        flash[:success] = "Customer deleted"
        # debugger
        redirect_to customers_path
    end
  </code></pre>
  
  <p>So based on my condition if it's true means customer can't be deleted, and that message to be displayed in a modal pop up window on Customers index page itself, how to achieve it ?</p>