I'm fairly new to Rails, so my guess is that I'm just doing this
wrong. I have a site that I'm building that uses ajax to update a
list of items depending on what tab a user clicks. Unfortunately, it
isn't live yet so I can't send a link directly to the site, but I have
it all working using straight HTML/JS/XML. Where the problems start
is when I try to use Rails to generate the update.
At first I tried to use RJS to push a partial template that loops
through each item to generate the html block that I need to push to
the list. I figured this would be easy and straight forward, but even
though I only have 2 items in the DB currently (will eventually be
hundreds) the list was taking 2+ seconds to update even locally. I
even tried changing my technique to use :update on a link_to_remote
instead of the RJS template with no increase performance.
but used a partial template to build the xml file that was requested.
This seemed to help the performance, but I still wasn't able to
decrease the load time to an acceptable amount.
Lastly, I'm trying to use an rxml template to build the xml instead of
looping within a partial template:
for p in @products
xml.item(:tags => p.tags, :id => p.id) do
xml.postedby("Lance 43", :id=>"12343")
xml.link("link 1", :id=>"1", :href=>"http://www.link1.com")
xml.link("link 2", :id=>"2", :href=>"http://www.link2.com")
xml.postedby("Ross C.", :id=>"123")
xml.content("This item works well elit, sed diam nonummy
nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Ut wisi enim ad minim veniam, quis")
xml.postedby("Peter J.", :id=>"356")
xml.content("Made some fixes to the wording and did some
other cleaning up. Man people sure spell bad. We should get a grade 10
class to go through this as a challenge.")
Most of the above is still static as I haven't updated the database
schema yet to include a lot of the fields. I want to try to get this
up and running properly before I go any further on other development.
This seems to get an initial load time of about a second, but then it
caches and goes blazingly fast. I'm currently on Dreamhost, and am
wondering if the slowness may be a factor of the host and not the
Please guys, any help would be GREATLY appreciated as I'm getting
close to ditching rails for this project all together and moving back