I'm using Ruby on Rails for the first time (Ruby on Rails 3 since Ruby 1.9.2, to be precise).
I love it. I found a great article on how to use RJS in Ruby on Rails 2.x. Since then, rail developers have removed the prototype rail dependency (which is important). However, by doing this, they also removed the functionality of RJS and link_to_remote with it. Now you should use link_to with: remote => true as an argument, but it has much less ability to remotely use remote things for you, like the link_to_remote + render (: update) method in rails 2.x.
I configured jQuery for UJS (UJS is an opportunity for you to create RJS-like functions with your javascript library (allows you to use other libraries than Prototype)).
So my question.
What's the best way to remove HTML remotely via AJAX and display it inside a div tag (as an example)? I want to be able to do this using similar functions like the old RJS, using render (: update), etc.
All help is much appreciated. I really hope that I don’t need to manually bind jQuery events to be able to load HTML remotely into the DOM, as the RJS functions looked so nice.
Thanks.
source share