I want to create a form that will add fields dynamically based on buttons the user clicks on. I am able to append raw HTML code, but erb code isn't properly being rendered.
Coffeescript Code:
field = '<%= hello %>'
$ ->
$('button').click ->
$('#tests').html(field)
When I click on the button, the entire string <%= hello %> is printed on the page. What do I need to add to ensure that the string I'm passing in is interpreted as erb code? Thank you