File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,34 @@ That's it!
2727
2828Note that it will render whatever is returned from JavaScript.
2929
30+ ## Configuration ##
31+
32+ You can configure the following options:
33+
34+ environment # The environment in which to execute the JavaScript. For example, you can load the Jade templating library into this.
35+ coffeescript_environment # Will take CoffeeScript, compile it, and set environment to that
36+
37+ ` render_execjs ` supports four syntaxes for setting configuration options (using the environment option as an example):
38+
39+ RenderExecJS.configure do
40+ self.environment = "'js environment'"
41+ environment "'js environment'"
42+ end
43+
44+ RenderExecJS.environment = "'js environment'"
45+ RenderExecJS.environment "'js environment'"
46+
47+ And two for getting configuration options:
48+
49+ RenderExecJS.configure do
50+ self.environment # => will return the environment
51+ end
52+
53+ RenderExecJS.environment # => will also return the environment
54+
3055## Why would I want to render JavaScript from Rails? ##
3156
32- Make sure that you're logged into your Twitter, now click on this link: [ http://twitter.com/tazsingh ] ( http://twitter.com/tazsingh )
57+ Make sure that you're logged into your Twitter, now click on this link: [ http://twitter.com/tazsingh ] ( http://twitter.com/tazsingh ) .
3358Notice how it loads your Twitter first, then the page that you've requested?
3459
3560It has to initialize the JavaScript environment before it can render the page you've requested.
You can’t perform that action at this time.
0 commit comments