Browse files

added examples of using the extended dot notation in hash keys to def…

…ine deeper variables
  • Loading branch information...
ejschmitt committed Sep 8, 2009
1 parent 9c4163b commit 0ab716b80e1a8d790a4fa3ee2062a1d95278367f
Showing with 5 additions and 1 deletion.
  1. +5 −1 README
@@ -10,7 +10,7 @@ Requires Json (require 'json')
./script/plugin install git://
in your controller:
@@ -21,6 +21,10 @@ jsvars[:myObject] = {:title => "My Page", :email => ""}
- Adds the object variables that can be used as myObject.title & in the view javascipt.
- This will add the object "myObject" if it does not exist, if it already does, only the variables will be added to the already existing object.
+jsvars['myObj.myMeth.myValue'] = "myVar"
+ - Adds the objects myObj, myMeth, myValue if they do not exist and defines the value of myObj.myMeth.myValue to myVar.
+ - Only undefined objects will be added, so if myObj exists but myMeth and myVal do not, they will be added to the myObj object.
Example of extending an object:
In controller:
jsvars[:login] = {:path => '/login'}

0 comments on commit 0ab716b

Please sign in to comment.