I’ve got a rails project in which I read in a template file and in the javascript console I get the following error:
illegal XML character
appointment_show.js?body=1()appoin...?body=1 (line 2)
[Break On This Error] this.JST["appointments/show"] = <%= topic %>;
Here is my current Backbone view I’m playing around with:
window.AppointmentView = Backbone.View.extend({
template: JST["appointments/show"],
render: function(){
this.$el.html(this.template(this.model.toJSON()));
return this;
}
});
Here is my app/assets/templates/appointments/show.jst file
<%= topic %>
All I had to do was rename my app/assets/templates/appointments/show.jst to show.jst.ejs