How can I evaluate an instance variable from within the javascript view (for use by another AJAX process)?
I would like do a conditional evaluation (in my test.js.erb file) of an instance variable defined in a controller method.
Controller method:
def test
@var = 100
end
.JS View:
if (<%= @var=100 %>) {
alert("var: " + <%= @var %>);
} else {
alert("failed");
}
Do I need to build the entire conditional check within erb tags?