Standard Web 2.0 coolness done easily and nicelyAs Rails users we are well familiar with
script.aculo.us and the Web 2.0 coolness that is pretty much built in to Rails.
Standard Web 2.0 coolness done betterTo be frank, our js framework of choice is actually
jQuery. We prefer the lighter weight, power and general
betterness.
Show stopper?Thing is, we've found a few negative points of using both jQuery and script.acol.us together:
- Heavier pages due to more libraries
- Slightly mitigated through packing and caching
- Not working nicely together
- Mixing frameworks is just plain messy
All is not lostSo, we've elected to use
jRails. We now use only one js framework resulting in lighter, cleaner and nicer Web 2.0 apps. No changes are required to most .rjs scripts and you still get pretty much all the functionality required from script.aculo.us.
Minor gotchaWe did find a slight omission however. Where script.aculo.us Ajax calls use
loading
to prescribe Ajax loading behaviour, jQuery uses
beforeSend
This is not supported in the current
options_for_ajax
We have been in touch with Aaron and hopefully a fix will be posted...Till then, here's a patch:
options_for_ajax
.
.
.
js_options['beforeSend'] = "function(xhr) {xhr.setRequestHeader('Accept', 'text/javascript'); #{options.delete(:loading)};}"
Of course, if you're using
Piston, you'll be fine.
p.s.More news soon on Moneyspyder's newest clients and work...!