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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:56:06+00:00 2026-05-25T22:56:06+00:00

This question is hard to explain so please bear with me. I have a

  • 0

This question is hard to explain so please bear with me. I have a table that contains rows which hold records from the Records table. i can add rows to this table using ajax and when i have entered the hours into a text field on the row and click away, the record gets submitted via ajax.
My problem is that i have a delete button next to each row. The rows delete as youd expect when i have refreshed the page or the rows where already in the Records table when the page was loaded. However if i have just added some hours and havent refreshed the page then i cannot delete the record.

After searching ive narrowed it down to this:

Already present record:

<a rel="nofollow" data-method="delete" data-confirm="Are you sure?" href="/records/2">

Just added:

<a class="delete" title="delete row" rel="nofollow" data-remote="true" data-method="delete" data-confirm="Are you sure?" href="Delete">

Because im using the ruby method “delete” from the Records controller it needs a href with the record id, thus “records/2”. this wont change until ive refreshed the page which is not what i want.

Ive thought about setting the href of the button when the record gets submitted but i have know idea how to do that in either js or ruby, plus id have to submit and then grab the record id back again. Or if someone can come up with a better idea other than the one above and “refresh the page when it submits” im all ears.

  • 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-25T22:56:07+00:00Added an answer on May 25, 2026 at 10:56 pm

    Iam guessing you are using rails so what u need to do is the controller should return a js response. check this question. to render erb code in JavaScript you should use escape_javascript.

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

Sidebar

Related Questions

This is a very hard to explain question and I hope my code extract
This question is hard to phrase, so I'm going to have to use some
This seems like a pretty softball question, but I always have a hard time
inHi, this question is fast, but from my point of view its pretty hard.
This is a really hard question to explain in words (well it is for
This is a really tricky question to ask as its very hard to explain
This is hard to explain as a question but here is a code fragment:
This question is more UI/Design-ish than hard-core programming is. Background: I've been coding in
Referring to this question: https://stackoverflow.com/questions/2035449/why-is-oop-hard-for-me class Form { protected $inputs = array(); public function
Alright, hard to phrase an exact title for this question, but here goes... I

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.