Good old C-style for loop in scala
Source: gist.github.com
Handle exceptions inside Actor
and then
Source: gist.github.com
Decompile scala
Scala collections #collect
Scala remote actors
Server
Client
Scala String replace
Worth remembering, thx to lopex
Run irb from file
In case I forgot.
Rails 3 remote update form
Rails 3 brings some nice unobstrusive javascript. This very short tutorial will show how to make simple yet powerful ajax update form.
First, grab jquery-ujs file (or gem). Next, create some model and REST controller.
Controller needs a small change:
Thats pretty self explaining: when object is valid send notice message, else send errors as json array.
View:
Only the :remote => true part is important.
Some JavaScript
This code will take remote form and register callbacks for showing loader, notice message and errors list.
And thats all, it simply works. And yes, you have to write CSS on your own ;]
Quickly get some random image placeholders
Big thanks to placehold.it!