I''m missing something basic ... How does one install jQuery in RoR? -- 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.
On Jan 31, 2010, at 11:45 AM, Ralph Shnelvar wrote:> > I''m missing something basic ... > > How does one install jQuery in RoR?The old fashioned way. Download it from jQuery.com and stick the .js files in public/javascripts. jQuery is not "supported" by the javascript helpers in Rails. But if you''re doing unobtrusive javascript, you won''t care. -- 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.
Steve Ross wrote:> On Jan 31, 2010, at 11:45 AM, Ralph Shnelvar wrote: >> >> I''m missing something basic ... >> >> How does one install jQuery in RoR? > > > The old fashioned way. Download it from jQuery.com and stick the .js > files in public/javascripts. jQuery is not "supported" by the javascript > helpers in Rails.But you can use the jrails plugin for that.> But if you''re doing unobtrusive javascript, you won''t > care.And you should be doing unobtrusive JS, in which case Rails'' helpers are indeed not much use. FWIW, I just started using jQuery. I''m a bit underwhelmed with its architecture. I may go back to Prototype, although I would like to get to know both libraries better before I make that decision. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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.
There are several blog posts on how to use jQuery unobtrusively with Rails. Yeah, don''t use the js helpers and RJS if you can avoid it! I''m currently in the process of creating a jQuery application template to install/configure jQuery widgets, jQuery UI and unobtrusive jQuery in a Rails app. Check my github rails3-templates at kristianmandrup. Have fun! BTW: If you want to learn jQuery, get the "jQuery in Action" book! -- 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.
On Sun, Jan 31, 2010 at 7:35 PM, Kristian <kmandrup-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> There are several blog posts on how to use jQuery unobtrusively with > Rails. Yeah, don''t use the js helpers and RJS if you can avoid it! > I''m currently in the process of creating a jQuery application template > to install/configure jQuery widgets, jQuery UI and unobtrusive jQuery > in a Rails app. > Check my github rails3-templates at kristianmandrup. > > Have fun! > > BTW: If you want to learn jQuery, get the "jQuery in Action" book! > >"jQuery in Action" is a very good book but make sure that you get the 2nd edition which covers jQuery 1.4. Cheers, -Conrad> -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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.
Ralph Shnelvar wrote:> I''m missing something basic ... > > How does one install jQuery in RoR?Use the following line in your layout ********************************************************* <%= javascript_include_tag "jquery 1.2.3.4" %> ********************************************************* alternatively, you can copy jquery files to your javascript folder and use :all option which will include/load all available javascript files ********************************************************* <%= javascript_include_tag :all %> ********************************************************* Note: you may encounter conflicts if you are using Prototype and Jquery together. In that case, use ********************************************************* jQuery.noConflict(); and then instead of "$" use "jQuery" ********************************************************* -- 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.
> Note: you may encounter conflicts if you are using Prototype and Jquery > together. In that case, use > ********************************************************* > jQuery.noConflict(); and then instead of "$" use "jQuery" > *********************************************************Somethng I am using ... validates_captcha ... uses Prototype. Hmm ... I wonder if this explains the odd behavior I am seeing when I tried to use the jQuery plugin, IconDock: http://icon.cat/wiki/IconDock_En#iconDock_jQuery_Plugin So ... I read http://docs.jquery.com/Using_jQuery_with_Other_Libraries and my question is: What are the odds that there will be a conflict? How can I find out definitely if validates_captcha conflicts with jQuery? -- 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.
Ralph Shnelvar wrote:> Somethng I am using ... validates_captcha ... uses Prototype.You could monkey-patch the render_regenerate_challenge_link of the captcha provider to emit jquery specific javascript. Or fork the project and make it js lib independent. Martin -- 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.
Ralph Shnelvar wrote:>> Note: you may encounter conflicts if you are using Prototype and Jquery >> together. In that case, use >> ********************************************************* >> jQuery.noConflict(); and then instead of "$" use "jQuery" >> ********************************************************* > > Somethng I am using ... validates_captcha ... uses Prototype. > > Hmm ... I wonder if this explains the odd behavior I am seeing when I > tried to use the jQuery plugin, IconDock: > http://icon.cat/wiki/IconDock_En#iconDock_jQuery_Plugin > > So ... I read > http://docs.jquery.com/Using_jQuery_with_Other_Libraries > and my question is: What are the odds that there will be a conflict? > > How can I find out definitely if validates_captcha conflicts with > jQuery?Remove jQuery and see what happens. But really, if you use noConflict, there should be noIssue. :) Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 6, 11:44 am, Ralph Shnelvar <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> > Note: you may encounter conflicts if you are using Prototype and Jquery > > together. In that case, use > > ********************************************************* > > jQuery.noConflict(); and then instead of "$" use "jQuery" > > ********************************************************* > > Somethng I am using ... validates_captcha ... uses Prototype. > > Hmm ... I wonder if this explains the odd behavior I am seeing when I > tried to use the jQuery plugin, IconDock: > http://icon.cat/wiki/IconDock_En#iconDock_jQuery_Plugin > > So ... I read > http://docs.jquery.com/Using_jQuery_with_Other_Libraries > and my question is: What are the odds that there will be a conflict? > > How can I find out definitely if validates_captcha conflicts with > jQuery? > -- > Posted viahttp://www.ruby-forum.com/.Well if you''re observing validates_captcha acting odd when you''re using jQuery, or vice-versa, you''ve found out.... Another easy way to avoid conflict between the various JS libraries is to do something like this: jQuery.noConflict(); (function($) { .... //jquery code goes here, allowing you to use $ willy-nilly... })(jQuery); you''ll need to make sure that the jQuery.noConflict() call comes *before* any code using Prototype or whatever runs (as validates_captcha uses the inline rjs helpers this shouldn''t be a concern, but I''ve yet to actually *use* validates_captcha so you''ll see) Completely offtopic though, I find jQuery overwhelmingly useful and intuitive. Granted, while its more just a "DOM manipulation, ajax and effects" library where Prototype is a general purpose Javascript framework, Javascript''s *soo* flexible and powerful that a library adding class-based inheritance and enumerators everywhere often gets in the way of the "Javascript-way" of doing things. -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Martin Andert wrote:> Ralph Shnelvar wrote: >> Somethng I am using ... validates_captcha ... uses Prototype. > > You could monkey-patch the render_regenerate_challenge_link of > the captcha provider to emit jquery specific javascript. > > Or fork the project and make it js lib independent.That is sooo far over my head. -- 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.