Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
theodorton committed Nov 12, 2012
1 parent 49f6f55 commit 762fd6b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ Some examples:
# or
App.Products.Show.autoexec(productItem)

# If you want modules to be autoexec'd several times
App.Products.Show.autoexec
idempotent: false

Finally, just add the module name to a data-autoexec attribute:

<body data-autoexec="App.Products.Index">
Expand Down Expand Up @@ -90,8 +94,9 @@ Require your modules and activate autoexecution (with turbolinks - default in Ra

#= require autoexec_bat
#= require_tree ./folder-containing-your-modules
jQuery(document).bind 'ready page:change', ->
$('[data-autoexec]').autoexec()
jQuery(document).bind 'ready page:load', ->
$('[data-autoexec]').autoexec
idempotent: false

For Rails 3:

Expand Down

0 comments on commit 762fd6b

Please sign in to comment.