How can i render a partial inside a tag on the clicking of a href tag.
<a href = "#" class= "addWidget" value = "Add Widget">add</a>
<script type="text/javascript">
$(".addWidget").click(function(){
<%= render :partial => 'form'%>
});
</script>
If you want to embed the partial content, you could simply:
Note that the html of your <%= render …%> code needs to be quoted in the Javascript – here I’ve done so with double quotes, but whether double or single, be sure to escape them in the rendering of the partial.