Reputation: 5200
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?
Upvotes: 3
Views: 201
Reputation: 115531
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).
Upvotes: 5
Reputation: 160191
Don't know about "most", but for some things, it's way easier than the alternatives (storing stuff in DOM, etc.) Would it conflict with Backbone? Dunno, but if you're using Backbone, what would you be using RJS for (except for non-Backboney parts, if any)? If you're using Backbone wouldn't you just use the Rails JSON bits?
Upvotes: 1