I am working on an app for the iPhone.  Due to possible bandwidth
constraints, I want to be able to sort in the browser.

Currently, I am doing @restaurants = Restaurant.find(:all, :conditions =>
['name LIKE ?', etc.. And it populates the view with a static list.  When I
click on any of the three cuisine choices, it goes back up to the server and
does another lookup and re-renders the partial via AJAX.  This works great,
but want to cut down the amount of trips back and forth to the server.

I have four buttons at the top of the screen: All | Thai | Indian |
Japanese.  I want to be able to click a button to show only one cuisine from
the list without having to go back up to the server.  Ie.show Thai only,
then change my mind and choose Indian, then show all again to see if I'm
missing a restaurant I may want to check out, then back to Japanese and
finally select a restaurant.  The details for that restaurant will slide
into view via RJS/Ajax.  When I click back to Restaurants, I want the exact
same sorted list that was there prior to viewing the individual restaurant.
The only trip to the server would be to pull the details of the restaurant
clicked.

I have zero experience in doing this sort of thing in Javascript in the
browser, so don't even know where to look.  I'm assuming there is some
Javascript object I can populate, just like the ruby @restaurants?

Thanks!


_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to