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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:27:07+00:00 2026-05-27T02:27:07+00:00

My Rails app uses the jquery.post() method to send some data from a clickable

  • 0

My Rails app uses the jquery.post() method to send some data from a “clickable” map marker to a controller in my application as seen below.

While the form field functions as normal (i.e. posts to controller and redirects to view), the clickable map marker only POSTs to controller and does NOT redirect to the specified view:

enter image description here

The server responses for the posts look like this

//--> THIS IS THE JQUERY 'POST' FROM THE MAP CLICK EVENT. DOES NOT REFRESH THE VIEW
Started POST "/index" for 127.0.0.1 at 2011-11-26 09:22:20 -0500
  Processing by SearchController#index as HTML
  Parameters: {"search"=>"The Hilton Club New York"}
Rendered text template (0.0ms)
Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.0ms)

//--> THIS IS THE RAILS FORM POST. THIS REDIRECTS TO 'index.html.haml'
Started POST "/index" for 127.0.0.1 at 2011-11-26 09:24:50 -0500
  Processing by SearchController#index as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"zjnYqbCB2iEob9g25310tYgZRRuF/WPTwplf92Rho0o=", "search"=>"Hilton Hotel, Avenue of the Americas, New York, NY", "commit"=>"GO"}
Rendered text template (0.0ms)
Completed 200 OK in 7ms (Views: 5.9ms | ActiveRecord: 0.0ms)

The Javascript looks like this

$.post("/index", {search: place.name},"data","html")

The Rails controller code looks like this

def index
  respond_to do |format|
    format.html {render :text => "You searched for : #{params[:search]}"}
  end
end

Any ideas?

  • 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-27T02:27:08+00:00Added an answer on May 27, 2026 at 2:27 am

    The third argument to “$.post()” is supposed to be a function, one that’s to be called when the HTTP request is finished. The library will pass the returned content to that function.

    Without a function there, whatever the server returns is simply ignored; the library cannot have any idea what to do with it.

    Even then, as @Esailija notes in a comment, if your server is issuing a redirect anyway it’s not a good fit for ajax in the first place.

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

Sidebar

Related Questions

I am retrofitting some code to a Rails 2.3.8 application. The whole app uses
I want to perform a search query from my rails app, which uses the
How to create a new rails 3 app that uses jQuery as a js
I have a Ruby/Rails app, which is standard Rails CRUD, with some jQuery and
My rails app uses sendgrid to send emails. I wanted to know if there
I am trying to build a Rails app that uses the YouTube data API
I have a rails app that uses heavily js (over 1MB total). I'd like
I have a Rails app that uses STI to handle different types of Users,
I've been working on a rails app that uses the restful authentication plugin. It
Hey--I'm writing a basic Rails app that uses the digg API. I'm trying to

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.