Hi,
How can i call some RJS as soon as the page loads. For example i want
to create a news ticker with the latest news items so it waits x amount
of seconds before replacing the news item with the next in the
collection. See Below:
list.rhtml
<% for article in @articles %>
<div id="latest_article">
</div>
<% i want call my rjs somewhere in here passing next article in
collection %>
<% end %>
show_article.rjs
page.delay(3.0)do
page.replace ''latest_article'', :partial =>
''article'', :object =>
@article
end
Is this even possible or am i going about this the wrong way?
JB
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---