Alexey Petrushin
2011-Jul-19 17:54 UTC
Re: Rails JS best practices? (jQuery + Prototype / MooTools
> CoffeScriptI like CoffeeScript and already tried it :). But as it said before, it''s supposed to be used with another libraries. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Trevor Burnham
2011-Jul-19 22:09 UTC
Re: Rails JS best practices? (jQuery + Prototype / MooTools
Hey, I''m the author of the CoffeeScript book<http://pragprog.com/book/tbcoffee/coffeescript> from PragProg. I noticed this conversation and thought I''d stop by. CoffeeScript goes great with either Prototype or jQuery. (One chapter of my book is a primer on jQuery.) As Walter said, while it''s possible to use both Prototype and jQuery on the same web page, it''s generally not very efficient because both libraries offer much of the same functionality. Prototype has traditionally had a large following among Rubyists because it provides lots of Ruby-like idioms. But jQuery is much more widely used and actively updated than Prototype, and is the official JS library as of Rails 3.1—even though the creator of Prototype, Sam Stephenson, works for 37signals. (He''s also become a strong advocate of CoffeeScript and was a technical reviewer for the book.) So, in short, I''d suggest sticking with CoffeeScript + jQuery. If you miss Rails'' functional programming goodness, check out Underscore.js<http://documentcloud.github.com/underscore/>. And if you feel like modifying native prototypes (e.g. adding an uppercasemethod to all strings), feel free. Check out how Prototype does it: https://github.com/sstephenson/prototype/tree/master/src/prototype/lang If you have any questions, you can always find me on Stack Overflow. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/fYFqRqNYSEoJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.