I’m doing a tutorial for rails animated loading page but the problem is that I get the following message undefined method `remote_function’.I’ve done some research and it seems that “remote_function” is deprecated.Can anyone tell me please how to I make the code work on rails 3.1 :
onload="<%= remote_function(:url => { :action => :get_content_to_display } ) %>"
Thanks for helping
Rails 3.1 prefered to use unobtrusive javascript. So you should use javascript framework (for ex. JQuery) to achieve your goal.
In old version of Rails
remove_functionjust sent AJAX request to server when it was called.So you can do something like this:
Hope it will help you. And here is some additional info: JQuery.get()