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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:55:32+00:00 2026-06-07T18:55:32+00:00

I have a form that will edit the record, I want it to use

  • 0

I have a form that will edit the record, I want it to use ajax though when submitting,

= simple_form_for(@lesson, :html => {"data-type" => :html, :id=>'lesson_form'}, :remote=>true) do |lesson_form|

= lesson_form.button :submit, 'Update'

but, in the lessons controller at update action, the request.xhr? evaluates 0, although I am setting remote to true at the form options above; request.xhr? does not evaluate to true.

So, what am I missing here ? How to use ajax when update my record ? Isn’t setting remote to true enough ? Any ideas please ?

thanks

  • 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-07T18:55:33+00:00Added an answer on June 7, 2026 at 6:55 pm

    You can do it many ways. Some of them are:

    If passing form data using GET, you can use jquery’s ajax() and send the request. That way
    you can use an explicit ajax trick i.e, have in-frame as medium of communication b/w form and submit. You can use this to validate the form as well, for example: checking to see if the username exists or not. In that scenerio you will have javascript interacting with your iframe and that iframe will have certain rules or markups for username that exists and vice versa.

    Hope this helps. I am happy to provide you with some sample code i wrote a looooong time ago if you want.

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

Sidebar

Related Questions

i have asked to create a module that will record video messages form the
I have a PHP form which I use to edit a record in the
The functionality I'm looking for: I have a form that will search my 'Proposal'
I have a windows form that has two DataGridViews (DGVs) that will hold 25,000+
(Using MySQL and PHP) I have a search form that will allow my users
I have a form in my application that will fill using Unicode characters (Non
I have created a form with knockout that will allow the ability to give
I have a form with a hidden Came from Adwords field that will be
I currently have a simple form that when you click the save button will
Javascript I have code that will hide various sections in a MS CRM form

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.