Skip to main content

modals

Modals should always be added directly to the body element if at all possible. This avoids any issues with z-index, focus, scrolling etc.
modals is a hook which allows modals to be easily added to the body element.

Here is an example of setting the modals with content_for:

# app/views/students/show.html.erb

<% content_for :modals do %>
  <div id="modal-container"></div>
<% end %>