Basically I want to toggle the value of an element on a page via RJS.
I can set the value fine, but I simply cannot figure out how to check
the current value. This is essentially what I want to do:
if page[“element_id”].value == “0”
page[“element_id”].value = “1”
page[“element_id”].value = “0”
The assignment lines (e.g. page[“element_id”].value = “1”) work fine.
It’s that line to check the current value of the element that is
Any experience with this?
(Note: I have the RJS Templates for Rails PDF “book”, but there is no
mention of detecting or assigning values. And as usual, there isn’t
much else out there on the 'Net.)