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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:43:11+00:00 2026-06-09T19:43:11+00:00

the jquery ajax post returns 404 Not Found in Firebug … is there anything

  • 0

the jquery ajax post returns 404 Not Found in Firebug… is there anything i am missing?

EDIT: this was working before and suddenly stopped working
routes.rb

  #invites
  match '/invites/request' => 'invites#request_invite'

invites_controller.rb

class InvitesController < ApplicationController

    def request_invite

        if !request.xhr?
            render_404
            return
        end

        email_exists = Invite.where(:email => params[:invite][:email]).exists?

        if email_exists
            @return = { :error => false, :response => "<div class=\"success\">Thank you!</div>" }
        else
            @invitation = Invite.new(params[:invite])

            if @invitation.save
                @return = { :error => false, :response => "<div class=\"success\">Thank you!</div>" }
            else
                error_message = '<div class="error_message">' + @invitation.errors.full_messages.map {|error| "<p>#{error}</p>"}.join + "</div>"
                @return = { :error => true, :response => error_message } 
            end
        end

        render :json => ActiveSupport::JSON.encode( @return )

    end

end

invite.rb

class Invite < ActiveRecord::Base

    validates :email, :presence => true, :uniqueness => true

    validates_format_of :email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i

end

javascript:

//post ajax
jQuery.fn.postAjax = function(success_callback) {
  this.submit(function() {
    $.post(this.action, $(this).serialize(), success_callback);
    return false;
  })
  return this;
};
$(document).ready(function() {

  $("#invites_form").postAjax(function(data){
    if(data.error == true){
      popup.init({
        title : "Please fix the following errors:",
        body : data.response
      });
    }
  });

});
  • 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-09T19:43:13+00:00Added an answer on June 9, 2026 at 7:43 pm

    i had changed how to access users pages from /users/show/:id to /:id and that caused the problem

    so i changed my routes.rb file to

      match '/:username/' => 'users#show'
      #invites
      match '/invites/request' => 'invites#request_invite'
      #get user profile pages
      match '/:username/:page' => 'users#show'
    

    and now it works fine

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

Sidebar

Related Questions

I'm making a jQuery Ajax POST request to a PHP script that returns an
I am posting to the server using jquery ajax using $.post. After server returns
I'm doing a jQuery AJAX post like this: var form = $(#formid); form.submit(function() {
How to pass multiple checkboxes using jQuery ajax post this is the ajax function
I'm doing a jQuery Ajax call to a PHP script that returns this string
i have ajax function that looks like this: jQuery.ajax({ type: 'POST', data: { action:
I have a jQuery AJAX post request that is unexpectedly triggering the error callback
if so can show simple example, ex in jquery ajax.post
A jQuery AJAX request .post()s data to page.php, which creates $res and var_dump()s it.
Assume we use jQuery.ajax() to POST data with two parameters, game_id and player_id .

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.