Guille San wrote:
> Hi
> Thanks a lot to the all people who answered the topic.
> I wanna to refresh only parts of the webpage, but at the moment I think
> that I´m so newbie for refresh only parts of the web.
> When I achieve refresh all the web, I´m going to started with the
> refresh of the parts I want to refresh.
It's really not nearly as hard as you might be thinking:
# Call get_averages and put its results in 'avg' every 10 seconds
# Generates:
# new PeriodicalExecuter(function() {new Ajax.Updater('avg',
'/grades/get_averages',
# {asynchronous:true, evalScripts:true})}, 10)
periodically_call_remote(:url => { :action => 'get_averages' }, :update
=> 'avg')
'get_averages' would be your controller action that would return the
partial HTML that updates the contents of <div id='avg'>...</div> every
10 seconds (by default).
There are also options for inserting before or after depending on what
you need.
--
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.