与 Rails 一起使用的最佳 JavaScript 库?

2022-01-18 00:00:00 widget ruby-on-rails ruby javascript

我想开发一个带有简单测验类游戏的应用程序(想想问题、答案、计时器、高分/排名,仅此而已)

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

为此,我想使用 Rails 和一些 javascript 库,让我对 GUI 产生一些现代效果(作为一个 GUI,你至少可以要求一个有吸引力的界面)

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)

我最初考虑过 ExtJS,但现在我认为这太严重了.还有数以百万计的原型扩展(http://stickmanlabs.com/lightwindow/ http://underwhelm.net/pinwheel/ etc) 看起来比较随意但不知道他们是否能很好地与rails一起玩

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

那么当后端将是 Rails 时,一般来说最好的 Javascript gui/widgets 库是什么?在我的特殊情况下,您会推荐什么?

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?

推荐答案

Scriptaculous 将是您的最佳选择.如果存在,其他库将与 Prototype 冲突.如果您正在使用您提到的功能创建一个简单的界面,您可能只需使用 Prototype/Scriptaculous 和一些插件就可以逃脱.JQuery 很棒,但是 $ 与 Prototype 覆盖冲突,导致它更难以使用.

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.

如果您需要原型方面的帮助,我发现 http://prototypejs.org/learn 很有用.

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

相关文章