Render partial in Javascript #74
jeremyevans
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Google Group Post: https://groups.google.com/g/ruby-forme/c/DTljHKAn0RI
Google Group Date: Wed, 5 Apr 2017 18:08:18 -0700
Google Group Sender: [email protected]
Hi,
We want to render a partial in Javascript, on a button click event.
$("#btnHistory").click(function (event) {
event.preventDefault();
$("#entry").html("<%= escape_javascript(render('_history')) %>");
});
It just prints
<%= escape_javascript(render('_history')) %>
in the view.
Please let us know, hot to render a partial in Javascript.
Thanks.
I.Murugesan
Beta Was this translation helpful? Give feedback.
All reactions