Edited: I must have misunderstood the RJS's purpose. Thought it was a JS lib, but it's not, it's just a way to generate JS code. And so i learned RoR's been using prototype. Sorry RoR fans, my bad
Edited: I must have misunderstood the RJS's purpose. Thought it was a JS lib, but it's not, it's just a way to generate JS code. And so i learned RoR's been using prototype. Sorry RoR fans, my bad
Prototype might actually be a tad bit older than jQuery even and it tries hard at "rubyfying" JavaScript. Because it does so by happily extending built-in prototypes and because it's a huge amount of monolithic code, over the years, people began moving to jQuery.
And now, finally, Rails is moving too.
Also note that with Rails 3.0, they began using data-* attributes for the framework-provided JS-dependent logic, so it became possible to easily replace the built-in prototype with jQuery. For 3.1, they are just switching the default.
RJS is a rails specific thing, but it's more a method of generating javascript inside of rails than a JS library in it's own right.
This change simply changes the default from Prototype to JQuery - a long-overdue change IMO, since the vast majority of the Rails community has been using solely JQuery for quite a long while now.
Here's hoping that the same treatment is done to RSpec vs. TestUnit.
Prototype is a stand alone library and predates jQuery by almost two years. jQuery is more or less a direct descendent of Prototype and reimplemented all it's features with a slight twist to emphasis method chaining which was a key insight that simplified everything.