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 6209057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:54:58+00:00 2026-05-24T05:54:58+00:00

I have several links I’m trying to create to either perform custom controller methods

  • 0

I have several links I’m trying to create to either perform custom controller methods or the destroy action. I’m using jquery via the jquery-rails gem and have ran the generator and seems to be including properly:

<script type="text/javascript" src="/javascripts/jquery.js?1312255663">
<script type="text/javascript" src="/javascripts/rails.js?1312407526">
<script type="text/javascript" src="/javascripts/jquery.min.js?1312255664">
<script type="text/javascript" src="/javascripts/application.js?1312256996">

Here is an example of a link using :method => :delete:

<%= link_to "Delete", list_path(@list), :method => :delete, :confirm => "Are you sure?" %>

with my routes.rb:

resources :lists

I think maybe the issue might be with my controller methods, but I still don’t understand why it would be rendering the show action, here’s my destroy method for the above link/controller.

def destroy
    @list = current_user.lists.find(params[:id])
    @list.active = false
    @list.save

    if @list.save
      redirect_to root_path, :notice => "List '#{@list.name}' deleted."
    else
      render :action => 'edit'
    end
  end

Is there anything obvious that I’m missing here, specifically with the jquery as that’s where a lot of people seem to have this same issue.

  • 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-05-24T05:54:58+00:00Added an answer on May 24, 2026 at 5:54 am

    I’m not sure whether or not the issue is related to jquery, but I would suggest replacing link_to with button_to. link_to should work too, but button_to is “the safest method to ensure links that cause changes to your data are not triggered by search bots or accelerators” (source: Rails API doc)

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

Sidebar

Related Questions

I have found several links to methods of making extension methods work in .NET2.0
So I have several links lined up using inline-block. When I hover over one,
I'm trying to create a generic Colorbox launcher for several links that need to
I am using several plugins, custom widgets and some other libraries from JQuery. as
Imagine that you have several links on a page. When you clicked, a div
Here's my scenario: I have a page containing several links; each link is meant
I have several such anchor links as shown below. <a href=http://google.com onClick=unhook()> Google </a>
I have several dynamically created links and forms on one page named with IDs
A user may have several labels, and links. Then, a user associates a label
I have web layout, which can contains several links on it. Those links are

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.