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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:42:35+00:00 2026-06-11T04:42:35+00:00

I have the following link: <a href=/kits?resource_id=536 class=authorize spin data-method=post data-remote=true id=use_it_link_171 rel=nofollow> After

  • 0

I have the following link:

<a href="/kits?resource_id=536" class="authorize spin" data-method="post" data-remote="true" id="use_it_link_171" rel="nofollow">

After I create the kit I change the link as follows:

<a href="/kits/536" class="authorize spin" data-method="delete" data-remote="true" id="use_it_link_171" rel="nofollow">

I changed the href and the data-method so that it should submit to the destroy action. However its still being submitted as POST

Why is that and how can I fix this so its submits as a ‘delete’?

  • 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-11T04:42:37+00:00Added an answer on June 11, 2026 at 4:42 am

    It’s because Rails uses unobstrusive javascript to set the behavior of tags like <a data-remote="xxx"> or <a data-method="xxx"> (in fact Rails creates an hidden form in your page that is submited when the link is clicked). It’s done at page loading by rails.js.

    So when you change the data-method attribute of the link, it’s “too late”, it does not changes the behavior of the link (you should update the hidden form for this). You could dig into rails.js code to find how to do it, but I suggest that you create 2 links in your page (one with data-method="post" and one with data-method="delete"), and use CSS to hide/display only the useful link.

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

Sidebar

Related Questions

I have the following link on index page <td align=center><a href=../athena/admin/update.php?id=' . $data [keyword]
Say I have the following link: <li class=hook> <a href=i_have_underscores>I_have_underscores</a> </li> How would I,
I have the following list <ul class=tabs> <li><a href=testlink.php>First link</a></li> <li><a href=testlink2.php>Second link</a></li> </ul>
I have the following: <div class=style-switcher id=colorChanger> <a style=background-color: #FFFFFF; data-style=arctic title=Arctic></a> <a style=background-color:
I have following link in a.aspx file: <a href=a.htm target=iframe>A</a> I want to set
I have the following code in my website: <link rel=apple-touch-icon href=http://website.com/images/apple-touch-icon.png /> When I
I've got the following link in my page, <a href=#dialog name=delete data-id=75351 id=delete-75351 >Delete</a>
I have the following file: <html> <head> <title></title> <link rel=css type=text/css href=/empty.css title=css />
I have the following link element: <a href=javascript:; onclick=check_show('http://www.test.com')>Test</a> <script> function check_show(link){ if($('#testelement).css('display') ==
I have the following a href link: <a href=@Url.Content(~/News/ +item.id+/+item.NewsSeoTitle)>title</a> That i use for

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.