Problem in Getting Records one by one

Hi All,

Here is the code I am using

<%= periodically_call_remote :update => “news_div”, :url => { :action =>
“get_news”}, :frequency => “5” %>

this is my method get_news

def get_news
@news = News.find(:all, :conditions => [“status => ?”, “Active”],
=> “created_at DESC”, :limit => 5)


<% for news in @news %>
<%= news.title %>
<% end %>

I want results to be displayed one by one not all at a time. What to do?
am stuck here, please help.

Thanks and Regards

Puneet Pandey
Ruby on Rails Developer

In Puneet’s Lab:

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
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
(ie, 5)



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs