Start by learning the basics of Rails. Work right through a good
tutorial such as railstutorial.org (which is free to use online).
Then when you understand the basics move on to the more advanced
stuff.
To find more about using UJS with Rails google for
ujs rails
and you will get many useful hits, and many useless ones of course