Reputation: 16339
Function call from javascript
Test.show({title : "Text",body : "Description" });
How can I call this function from RJS ?
page << "Test.show({title : "Text",body : "Description" });"
page.call "Test.show", "{title : "Text",body : "Description" }"
Any solution ?
Upvotes: 0
Views: 354
Reputation: 7288
you need to escape " to form valid function call syntax, for this you can use ' single quote like
page << "Test.show({title : 'Text',body : 'Description' });"
or
page << %{ Test.show({title : "Text",body : "Description" }); }
Upvotes: 1