Is there any User Interface Library for rails?

Hi guys,
    I ever used YUI(Yahoo User Interface Library). It's great. But it
is hard to use within Rails. I wants to implement the modal dialogs
using such a library. Is there any User Interface Library for rails?

Thank you very much. I get the ExtJS plugin for Rails, it's wonderful.

Check out Redbox http://blog.craigambrose.com/articles/2006/08/16/redbox-a-rails-compatible-lightbox, I have used it and it is awesome.

Bala Paranj said the following on 19/12/07 05:17 AM:

Check out Redbox
http://blog.craigambrose.com/articles/2006/08/16/redbox-a-rails-compatible-lightbox,
I have used it and it is awesome.

I can see where it would be useful.

I do wonder about using something like that for error handling though.

Suppose I have an "Oops" mechanism, perhaps with controller and
templates, perhaps not. It would be invoked programmatally with
arguments.

It may be simply a "I'm sorry Dave, you can't do that" access control an
go back yo where you were, or more sophisticated with redirect on close,
buttons ...

Of course I want this to be lightweight :slight_smile:

Of course I can't pre-load the page with every possible error and
dialogue box.

I looked at the Yahoo User Interface Library but the learning curve is
steep for such simple requirements. All the components seem to be in
scrptalicious but is there a plugin or ... something ... that bundles
them nicely?

You want RJS. Here’s a good tutorial on the matter:
http://www.rubynoob.com/articles/2006/05/13/simple-rails-rjs-tutorial

Jason

You can do remote calls with RedBox. Something like link_to_redbox_remote or link_to_remote_redbox. I tried it once earlier this year and it was pretty slick. I had some problems with it not working correctly in IE6 and the author never responded to my requests for help, so I gave up and took it out.

Phillip

Jason Roelofs said the following on 19/12/07 10:51 AM:

You want RJS. Here's a good tutorial on the matter:
http://www.rubynoob.com/articles/2006/05/13/simple-rails-rjs-tutorial

Hmm. To be honest I don't find that helpful. There's a lot it doesn't
tell me.

What I have right now is an "Oops" (as in "Ooops!") controller and a
small set of actions.
The views are all .. well think of them as a big red box (no, not that
RedBox), possibly with a graphic of a bomb, an exclamation or question
mark or a 'stop sign' as appropriate. There's the message and in most
cases an "OK" button. Simple modal box. The message may be an array.
The OK button is a link_to, usually back to the page that caused the error.

There's a small class of boxes that have more than one button. E.g

message => "You need to be logged in to do that"
buttons => [ { name => "Register" , :action => 'register' },
             { name => "Log In", :action => 'login' },
             { name => "Go Back", :action => link to calling page }
           ]

And an even smaller class that are actually dialogue boxes. Entering
authentication codes and the like.

I suppose that I can recycle the views for each action ?
But how much do I have to change my code?

I suspect that the warning boxes will be a lot simpler, just make the
box go away and the 'previous' page is still there.

There seem to be some efforts regarding plugins for Rails and Ext JS.
Here are the ones I know of:
* Toolbawks Ext (seems to be an installation helper):
http://svn.toolbawks.com/toolbawks_extjs/trunk/INSTALL
* Ext plugin (providing controller methods to generate Ext components
- not sure whether this is being actively developed, support for Ext
2.0 seems to be coming in the future?): http://wota.jp/ac/?date=20070406
* An "Experiment" providing Rails helpers for Ext JS, looks abandoned
as code is no longer around: http://extonrails.com/

I recently played with Ext and Rails myself and documented the effort
here:
http://inside.glnetworks.de/2008/01/08/ext-js-and-rails-how-do-they-get-along/

This demonstrates basic solutions for Rails integration and features a
"soon-to-be-announced" Ext Scaffold Generator plugin for Rails - a
preview version is available on Rubyforge: http://rug-b.rubyforge.org/svn/ext_scaffold