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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:23:54+00:00 2026-06-02T17:23:54+00:00

I am pretty new to Sinatra and am making a simple todo app that

  • 0

I am pretty new to Sinatra and am making a simple todo app that utilizes basic CRUD functionality.

In the backend I have working routes and have tested everything. I wanted to incorporate some front end functionality and decided to use jQuery to help with that. I have a current piece of code in jQuery that adds a css class to one of the todo items when that item is clicked. I wanted to include a button that says “Delete completed tasks” that would collect the tasks with the class of “completed” and than trigger the Sinatra route which would delete the tasks from the database. The current Sinatra route is:

delete "/hub/note/:id" do
   n = Note.get params[:id]
   n.destroy
   redirect '/hub'
end

How do I get jQuery and Sinatra to communicate the delete the items with the class of “completed”. Any help would be incredibly useful.

  • 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-02T17:23:56+00:00Added an answer on June 2, 2026 at 5:23 pm

    Utilizing the method_override trick/hack, you can get what you want by doing this:

    jQuery.post("/hub/note/" + id, {_method: "delete"}, callback);
    

    Anything leveraging Rack, including Sinatra and Ruby on Rails, should have this behavior.

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

Sidebar

Related Questions

Pretty new to threading and I have this QList that the threads share between
Im pretty new to Dreamweaver. Im having a problem. I have a website that
Am pretty new to SharePoint, am working on creating a custom permission that I
I am pretty new to php, but I am learning! I have a simple
I'm pretty new to iPhone development but I'm close to releasing my first app
I'm pretty new to c# and I'm trying to make a function that checks
I am pretty new to image capturing using java. Just started working in java.
Pretty new to the Magento e-commerce solution. Have it up and running for a
still pretty new to android I have to clone an iphone application. Im having
im pretty new to jQuery, and i dont know how to do that, and

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.