Not sure if using jquery is the right way in closing this modal window that was rendered through ajax...
$ ->
$('body').on 'click', '#Close', ->
$("#Root").hide()
When I tried this, it only works once. If I click on another object to open a different modal window, the hide doesn't work.
#Root
#Bg
#Main
#Info
#MainControls
#Close{style: "cursor:pointer;"}
%a.CloseButton
%i X
The modal window is being rendered through this:
$('body').append('<%= j render partial: "trips/quick_view" %>');
In my views:
@trips.each do |trip|
= link_to trip.id, quick_view_trips_path(:js, id: trip.id), remote: true
The modal window produces dynamic content, so I'm not sure what is the best way to close this and won't lag the application if people are closing and opening different objects.