views:

756

answers:

8

I want to develop an application with simple Quiz-like games (think of a question , answer, a timer, high-scores/ranking, not much more)

For that I want to use Rails and some javascript library that let me have some modern effects on the GUI (being a GUI the least you can ask is for an atractive interface)

I first considered ExtJS but now I think is too serious for this. Also there are millions of extensions for prototype(http://stickmanlabs.com/lightwindow/ http://underwhelm.net/pinwheel/ etc) that looks more casual but dont know if they will play well with rails

So what is in general the best Javascript gui/widgets library out there when the backend is going to be Rails? And in my particular case what would you recommend?

+3  A: 

Prototype and Scriptaculous come with Rails by default. Prototype has a great API that cleans up much of the deficiencies that are inherent with different browsers' JavaScript Engine. Scriptaculous provides some nice effects, but in my opinion has been surpassed by JQuery and its available plugins.

I'd suggest staying away from YAHOO's YUI library. It tends to be unnecessarily complex.

Is any JS library the best? That is of course, a matter of opinion.

BCOT.

BigCanOfTuna
A: 

Prototype and scriptaculous, Jquery, Mootools or moofx are some.

Corban Brook
A: 

I'd personally say that Mootools and Prototype/Scriptaculous are the two best libraries if your only interested in the GUI aspect of it, although jQuery has also recently seriously stepped up its animations and effects. All of the above libraries also have huge amounts of plugins you can use, so really it's just down to whichever one tickles your fancy.

Other libraries like YUI and ExtJS are gonna be way more complex then you need for something like this.

tj111
A: 

Prototype for the following reasons:

  • Prototype is a spinoff and is directly influenced by the requirements of the Ruby on Rails framework.
  • Prototype and Ruby programming language have an intentional similarity between Ruby's built-in classes and many of the extensions implemented by this library.
  • Ruby on Rails ships with the Prototype library
aleemb
+1  A: 

Scriptaculous will be your best choice. Other libraries will conflict with Prototype, if it is present. If you are creating one simple interface with the features you mentioned, you can probably get away just using Prototype/Scriptaculous and a few plugins. JQuery is great, but the $ conflicts with the Prototype override, causing it to be more difficult to work with.

If you need help with prototype, I found that http://prototypejs.org/learn is useful.

EureMir
jQuery provides easy way to not conflict with $ (for more info see jQuery.noConflict() method).
Svitlana Maksymchuk
A: 

My vote goes for Prototype/Scriptaculous combo or jQuery as well. And because Prototype was written to be used with RoR, that's probably your best bet - best set of user documentation etc.

+3  A: 

jQuery works just fine. In addition, jQuery works with Prototype if jQuery is run in the compatibility mode (Google: jQuery compatibility mode).

If you want to use all Rails' helper methods for AJAX requests with jQuery, go and try jRails. I prefer working with jQuery, since it is more widely used than Prototype.

All in all, both jQuery and Prototype are very good choices with Rails.

Its also worth looking Mootools. Here is one artictle worth reading jQuery vs. Mootools. I am not sure how well Mootools works with Rails' helper methods.

Pekka Mattila
A: 

Dojo works very well with the drails plugin.

drails is a Rails plugin that provides a Dojo implementation for the Rails helpers. It overrides the Prototype and Scriptaculous helper methods in Ruby on Rails and replaces them with Dojofied methods.

I prefer dojo for the following reasons:

  • It provides everything already included. All of the namespace are very extensive.
  • ShrinkSafe. Dojo uses ShrinkSafe to reduce the size, and therefore latency, of JavaScript by browsers. ShrinkSafe is smart enough to provide a custom build that only includes the necessary components.
  • The current Dojo version's benchmark claims that it is faster then any other toolkit on most browsers.
  • The plugd plugin extends dojo to act like jQuery.
the_drow