Note: This introduction post to jRails is copied(mirrored) form this link, so that I can bakeup this for advanced learning.
Intro
jRails is a drop-in jQuery replacement for Prototype/script.aculo.us on Rails. Using jRails, you can get all of the same default Rails helpers for javascript functionality using the lighter jQuery library.
News
jRails 0.4 : jQuery 1.5!
jQuery-UI has just gotten a major update to version 1.5 which stabilizes most of the controls and incorporates the Enchant effects library. jRails follows suit with a single js file for jquery-ui that includes both the modules and effects. The default jRails installation includes a compressed jquery-ui js file that includes the basic modules and effects supported by Prototype/Scriptaculous. There are no modifications to this file, so if you’d like to generate your own with additional modules or effects, just pop on over to the jQuery UI site and customize your own.
This release of jRails also adds support for jQuery.noConflict(). Just uncomment the line in the init.rb file and set it to whatever you like. Now you can use jRails with other libraries without causing problems.
Features
jRails provides drop-in functionality for these existing Rails methods.
Prototype
form_remote_for
form_remote_tag
link_to_remote
observe_field
observe_form
periodically_call_remote
remote_form_for
submit_to_remote
Scriptaculous
draggable_element
drop_receiving_element
sortable_element
visual_effect
RJS
hide
insert_html
remove
replace
replace_html
show
toggle
Visual Effects
These are the current effects that are included by default in jRails.
Appear
Fade
Puff
BlindDown
BlindUp
BlindRight
BlindLeft
SwitchOff
SwitchOn
SlideDown
SlideUp
DropIn
DropOut
Shake
Pulsate
Squish
Fold
FoldOut
Grow
Shrink
Highlight
How to use
Just install and go! Once installed, the previous Prototype/script.aculo.us helpers will be replaced by jQuery ones. In order for them to function correctly, just include the appropriate javascript files in the head of your page.
Then copy the javascript files in the plugin folder to your javascripts directory.
Changelog
: Initial Release
: Major Effects Updates
: jQuery Enchant
: jQuery-ui 1.5 and jQuery.noConflict support
Contact
You can post to the jRails group forum and I’ll get back to you as soon as I can
Comments, bug reports and feedback are welcomed. I’m also considering developing a similar library for MooTools so if you are interested, please let me know.
This post is a copy of my work stuff, but I want to archive all the links below, they are all about SEO on Rails application, as well as a useful post about jQuery on Rails.
Finally, we decided to create a Rails App for the EQV2 New Website, so I did several homework for this mission. They are:
But, first version should be structured well and make sure it’s been done before the “deadline”, so this app will be according to the recommendation but not totally implemented in the best way, in all, it still needs your suggestion.
最新评论