Here is my approach to quickly enabling Unobtrusive Javascript support for your Rails application, using jQuery:
- Create a Rails application without Prototype support
- Edit your config/application.rb to include the latest jQuery and the Rails UJS adapter for jQuery:
Update (May 4th) for jQuery 1.6:
- ...oh, I said 3 steps, right!
Just continue building your application; here's an example: YouTube-like-comments.
Or...
ReplyDelete1. put 'jquery-rails' in your Gemfile
2. run 'bundle install'
3. run 'rails g jquery:install'
Tip you can pass --ui to the generator command to install jquery-ui too.
Yes, this are 3 steps and you cheat to make it in two (1.5- Download rails ujs adapter for jquery)
I like this approach better.
He he, thanks for the tip! ;o)
ReplyDelete