Hi Matt,
I am also trying to achieve something like http://livingsocial.com, I
went through your topic and found that you've solved the same problem..
Can you help me with some code.. here is what I've done so far.
##ajax_call.rhtml
<% @products = Product.find(:all, :limit => 50, :order => "id DESC") %>
<% for product in @products %>
<%= periodically_call_remote(:url => {:action => "time", :id =>
product.id}, :frequency => 5.0, :update => 'product_div') %>
<% end %>
<div id="product_div">
</div>
##controller
def time
@product = Product.find(params[:id])
end
##time.rhtml
<h2>Current Product is: <%=h @product.product_name %></h2>
The problem is it is continuously overwriting the div, where as I want
the list to come. Please help me with some code
Thanks
Puneet
Matt Harrison wrote:
> On Wed, Sep 09, 2009 at 04:53:13PM +0100, Matt Harrison wrote:
>> try {
>> } catch (e) { alert('RJS error:\n\n' + e.toString()); alert(''); throw e }
>
> I'm sorry for the line noise, I seem to have found the problem. It
> ocurred
> to me that both the periodically_call_remote and the rjs were both
> specifying what to change. I removed the :update param from the
> remote_call
> and now it seems to be working fine.
>
> Now I just need to work on the fancy scroll effect that they use :)
>
> Matt
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---