Topics
Ajax/JavaScript libraries in Rails
PrototypeHelper
ScriptaculousHelper
JavaScriptMacrosHelper
JavaScript related utility methods
Ruby JavaScript template

Ajax/JavaScript Libraries in Rails
• Prototype – used mainly for Ajax
> ActionView::Helpers::PrototypeHelper
• Scriptaculous – used mainly for visual effects, drag and drop, auto-completion
> ActionView::Helpers::ScriptaculousHelper
• JavaScript related utility methods
> ActionView::Helpers::JavaScriptHelper
• Others can be easily added

How to Include Ajax?JavaScript Libraries
• Option 1: Use <%= javascript_include_tag :defaults %> in the HEAD section of your page (recommended):
> Return references to the JavaScript files in your public/javascripts directory.
> Recommended as the browser can then cache the libraries instead of fetching all the functions anew on every request.
• Option 2: Use <%= javascript_include_tag ‘prototype’ %>
> Will only include the Prototype core library
• Option 3: Use <%= define_javascript_functions %>
> Will copy all the JavaScript support functions within a single script block. Not recommended.

SEE MORE DETAILS VIA Download the PDF stuff.

最近发现了几个UI framework,接下来我要把他们和RoR优美的结合起来,这样以来,在做什么应用的时候,就不愁没有Style了。

1. 一个依赖于JQuery的UI库,很喜欢。http://jqueryui.com/

2. 一个依赖于PrototypeScript.aculo.us的库,也很不错。http://scripteka.com/

3. 还是一个基于Prototype的UI库http://livepipe.net/

4. YUI, Google搜索“UI Framework”得到的第一个链接。

© 2011 Refactoring Thoughts Suffusion theme by Sayontan Sinha
普人特福的博客cnzz&51la for wordpress,cnzz for wordpress,51la for wordpress