Topic: Repeat an AJAX search request

Hi!

I've built a member-management tool. In the list-view, you have a textfield, where you can
enter a search term and you have and advanced search where you can search only in some columns. The request is sent to the server via ajax and the server sends back the new list.
Now I've implemented a sort-function, which also uses ajax. The user can select fields, which will be in the :order term. When the user makes a change to the fields he wants to sort, the change is also submitted via ajax.
Now the member list should also update, to show the new order. But therefor I've to know, how the last search request was like, so that I can repeat it with the new order.

Whats the best way to save the last search-request and then repeat it?

Thanks in advance!

My homepage: http://www.komendera.com/
Working at: http://www.abloom.at/
My blog: soaked and soaped http://soakedandsoaped.com/

Re: Repeat an AJAX search request

You could store the request parameters in the session or flash. 

session[:search] = request.parameters

Re: Repeat an AJAX search request

You could also resend the search request again in the URL using JavaScript. Not very convenient though because I don't think you can use helpers if you do this.

Railscasts - Free Ruby on Rails Screencasts

Re: Repeat an AJAX search request

Thanks!
I saved the request.parameters in the session. So I always have the last search paramters to repeat the search.

My homepage: http://www.komendera.com/
Working at: http://www.abloom.at/
My blog: soaked and soaped http://soakedandsoaped.com/