I am making a function that on click it will append more date fields. Although the 'form' tag keeps getting outputted by the file and failing.
$('.add-date-btn').click(function(e) {
e.preventDefault()
console.log('btn clicked')
var appendStr = '<div class="form-group classes-field-one-time date-field">' +
'<label>If recurring once: <br />Add Date</label>' +
'<%= form.date_field :event_date, :class => 'form-control' %>' +
'</div>'
$('#recurring-dates').append(appendStr)
})
The line "form.date_field" is what is failing. How can I add this to a string?