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

  • SEARCH
  • Home
  • 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 8463629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:30:33+00:00 2026-06-10T14:30:33+00:00

With rails 2.3.8 I had = link_to ‘old_Delete’, link_path(@link), :confirm => ‘Are you sure?’,

  • 0

With rails 2.3.8 I had

= link_to 'old_Delete', link_path(@link), :confirm => 'Are you sure?',  
:method => :delete

With rails 3.1.8 this no longer works, no error and the log just shows a show request.

I tried changing it to

= link_to 'Delete', link_path(@link), method: :delete, 
data: { :confirm => 'Are you sure?' }

but that didn’t help either.

How can I have a delete link that works.

I created a new app (rails 3.2.7) with a ‘post’ resource to see how links look in a new app.

The link generated for that was:

= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' }

but when I try to use that format, replacing post (Post resource, model, etc.) with @link, the link instance that I am using elsewhere on the page, i.e.

= link_to 'Destroy', @link, method: :delete, data: { confirm: 'Are you sure?' }

It doesn’t work (no error).

I tried saving rails.js in my public/javascripts folder (I have assest compilation turned off) and including config.action_view.javascript_expansions[:defaults] = %w(jquery rails) in my config/application.rb but it didn’t help, still seeing gets and no deletes happening.

  • 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-10T14:30:35+00:00Added an answer on June 10, 2026 at 2:30 pm

    As others have said you probably have a typo, link vs @link. But the reason the delete stopped working is probably centered around the change to UJS. Long answer, google “rails change to ujs in 3.0”. Short answer, make sure your app is loading rails.js from an appropriate ujs helper provider, such as https://github.com/rails/jquery-ujs

    Make sure that, along with your other changes you change:

    = javascript_include_tag "application"
    

    to

    = javascript_include_tag :defaults
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had this app using 1.9.2 and rails 3.2 and today I changed the
I have had this problem w/ two seperate WYSWYG editors in my rails application
New to rails, so if this is discussed somewhere, just link me off: I
I am using Ruby on Rails 3.0.9 and I had this problem: Trouble on
I get the following error when restarting my rails app. I've had this problem
This has been fixed. I guess I had left :method => put in the
I had an app based on Rails 3.0. This is a prediction app and
I just upgraded my Leopard system to Snow. I had a Rails application with
I had ruby 1.8.7 and rails 2.3.5 installed on my machine.I had install RVM
I had the gmaps4rails gem version 1.4.5 working nicely on my Rails 3.2.2 app.

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.