I don''t know the correct solution. But you are fetching 5 records,
therefore, it will display all of them. You can use javascript effects to
generate some effects or fetch 1 record at a time.
BTW, hope you know that some new items may not be displayed if rate of
generation of new news items is more than the limit in your find condition
(ie, 5)
Thanks,
Abhinav
--
अभिनव
http://twitter.com/abhinav
On Wed, Sep 9, 2009 at 1:23 PM, Puneet Pandey
<puneetitengineer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:
> Hi All,
>
> Here is the code I am using
>
> <%= periodically_call_remote :update => "news_div", :url
=> { :action =>
> "get_news"}, :frequency => "5" %>
> <div id="news_div">
> </div>
>
> this is my method get_news
>
> def get_news
> @news = News.find(:all, :conditions => ["status => ?",
"Active"], :order
> => "created_at DESC", :limit => 5)
> end
>
> /views
>
> <% for news in @news %>
> <%= news.title %>
> <% end %>
>
> I want results to be displayed one by one not all at a time. What to do? I
> am stuck here, please help.
>
> --
> Thanks and Regards
>
> ___________________
>
> Puneet Pandey
> Ruby on Rails Developer
> http://www.puneetitengineer.wordpress.com
> In Puneet''s Lab: http://www.puneetpandey.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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---