Search code examples
javascriptjqueryruby-on-railsrubybackbone.js

What is the Current State of the Art in AJAX + Rails?


I was quite surprised to read about RJS in Rails 3. Is this the way most rails sites work with AJAX?

And if I'm working with Backbone (and this is a good example), won't it have conflicts with ujs?


Solution

  • Rjs is easy to use but is not the proper way to deal with Ajax. Rails developers know that; all the more, RJS should be extracted to a gem. Yep, sever side js is not that scalable.

    Backbone has been developed with Rails backend, and it's philosophy is a bit inspired from the framework. So you won't have any problems: it has been extensively tested.

    Speaking about Backbone and Rails, I suggest you use the backbone-rails gem (my fork handles better the delete method but hasn't been merged yet).