Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8693785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:37:25+00:00 2026-06-13T00:37:25+00:00

In a form, I have: = link_to Delete toy, @toy, :method => :delete, :confirm

  • 0

In a form, I have:

= link_to "Delete toy", @toy, :method => :delete, :confirm => "Are you sure?", :class => "btn btn-danger"

This generates the following html:

<a href="/toys/258" class="btn btn-danger" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Delete toy</a>

However, when I click the link, I simply get taken back to the show page of the toy. (I don’t get the confirm popup either.) What am I doing wrong?

I added a = javascript_include_tag :all and = javascript_include_tag "application" inside my application.html.haml, per the recommendation a bunch of the other posts on SO about this exact question, but it didn’t help.

UPDATE: this is what is in my application.js file:

//= require jquery
//= require jquery_ujs
//= require_tree .
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:37:26+00:00Added an answer on June 13, 2026 at 12:37 am

    Remove the = javascript_include_tag :all part of your layout. This is probably loading jQuery-UJS twice, the second overwriting all configured listeners.

    With the asset pipeline, you’ll only ever need to include “application”, and never all the other files.

    (same happens with the stylesheets)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form: <% @page_title = Delete Technician: #{@technician.name} %> <%= link_to(<< Back
I recently ran into this problem: Rails 3 link_to (:method => :delete) not working
I have the following: var doHandler = function (link, form, close) { var $form
I have a login form for my website. This login form have two text
I have a form to add new Appartments, and in this form I have
This is probably a simple question, I have a form that you put in
So I have this form which requests a JS call when a comment is
I have a link to delete action using Jquery dialog confirm message. Clicking on
I've set up a Rails form roughly following the instructions in this Railscast. Here's
I have a delete file link on a page: <form id=myForm runat=server> <asp:LinkButton ID=deleteFileLink

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.