I am trying to create a div, that is being appended to another div. Seems to be working but, the ruby code is not recognized and the image tag does not load:
function add_event(event)
{
var div=document.createElement('div');
div.innerHTML='<%= image_tag("events_pics/band.png", :class=> "event_pic_small") %><h6 class="event_info">Event_1: Frame: 974</h6><a class="btn btn-mini btn-danger pull-right " href="#"><i class="icon-remove"></i></a>';
div.className='user_event my_background';
$("#event_list").append(div);
}
Plus I would like to assign a function on the <i class="icon-remove"></i>
so, is there a more elegant way to create that div?