I want to create a news ticker. I pull the top five articles from the
database in my controller and pass it on to my view. I have a ticker
bar, and I want to cycle through each article continuously. I
previously did this with custom javascript from an RSS feed.
Any ideas?
Thanks.
It's expensive, but periodically_call_remote will issue an Ajax call
to your server at a specified interval and you can then update a div
containing your news blip.
I'm familiar with the commands, it's implementing them that's causing
me headaches. When I try using
<%= periodically_call_remote(:update => 'ticker_headline', :frequency
=> 3, :url => { :partial => 'article', :collection => @articles }) %>
in or outside of my tag, it loads the entire home page over again and
puts it inside. NOT the article title I want...
What about passing the @articles collection to cycle? Anyway to use
that with JavaScript to accomplish the same thing without the expense
of periodically_call_remote?
Are you rendering with
:layout => false
in your callback function?
What about using custom JavaScript and passing the articles
(@articles) to that JavaScript from the controller?