# Triggering an AJAX request

**URL:** <https://www.ruby-forum.com/t/triggering-an-ajax-request/119036>\
**Category:** Rails\
**Created:** [November 2, 2007, 12:31pm UTC](https://www.ruby-forum.com/t/triggering-an-ajax-request/119036 "2007-11-02T12:31:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [November 2, 2007, 12:31pm UTC](https://www.ruby-forum.com/t/triggering-an-ajax-request/119036/1 "2007-11-02T12:31:31Z")

</div>

Hello,

I am sure this situation is quite common and nothing complicated to  
solve, but I’d like to know the Rails way of doing it:

Screen 1)  
I have a search form. After clicking ‘search’, the results are displayed  
with AJAX.

Screen 2)  
I have some records on the page, which are associated with the data from  
Screen 1). Clicking on a record should redirect to Screen 1), fill the  
search form based on the record from Screen 2 (so far so good) AND  
display the AJAX results (without the user clicking the ‘Search’ button,  
of course).

What’s the standard way of doing this?

Cheers,  
Peter

* * *

[http://www.rubyrailways.com](http://www.rubyrailways.com)  
[http://scrubyt.org](http://scrubyt.org)
