load search results into a div jquery and rails
- by odpogn
In my rails app I have a search bar where users can search other users. Currently when a User submits the search from, they're redirected to a "results" page. I want to load those results in a div on the same page.. I was able to do this with my websites navigation links, but I'm pretty new to jQuery and rails and can't figure this one out...
my jQuery corresponding to my navigation links:
$(function() {
$('#links a').live('click', function() {
$('#pages').load(this.href).fadeIn('slow');
return false;
});
});
my attempt to do the same with my search function...
$(function() {
$('#search').submit(function() {
$('#pages').load(this.href).fadeIn('slow');
});
});
any help would be much appreciated~ along with some useful jQuery tutorials for a newbie!!