what is the best javascript ui library for rails

I like jquery-ui. It has some nice themes buildt in, and many plugins
available. But most important: it's very leightweight!

http://jqueryui.com/

Since jquery is the "native" javascript plugin in rails, jquery-ui
should also be the best choice. There is even a nice plugins for rails

= 3.1, which configures all you need for the asset-pipeline:

https://rubygems.org/gems/jquery-ui-rails

If you need some "special" plugins, eg for a MVVM approach, just look
for nice plugins, ideally with themeroller-support. Example:

http://datatables.net/
, and many more.

If you want to have a bad time, consider using heavyweight and slow
JS-Frameworks like ExtJS (Sencha). Implementing the UI then would take
way longer then the whole application without styling, only for the
benefit of having some complex widgets. Exspecially ExtJS development
feels exactly like raw Java/Swing. Your choice.