/* The blacklight modal plugin can display some interactions inside a Bootstrap modal window, including some multi-page interactions. It supports unobtrusive Javascript, where a link or form that would have caused a new page load is changed to display it's results inside a modal dialog, by this plugin. The plugin assumes there is a Bootstrap modal div on the page with id #blacklight-modal to use as the modal -- the standard Blacklight layout provides this. To make a link or form have their results display inside a modal, add `data-blacklight-modal="trigger"` to the link or form. (Note, form itself not submit input) With Rails link_to helper, you'd do that like: link_to something, link, data: { blacklight_modal: "trigger" } The results of the link href or form submit will be displayed inside a modal -- they should include the proper HTML markup for a bootstrap modal's contents. Also, you ordinarily won't want the Rails template with wrapping navigational elements to be used. The Rails controller could suppress the layout when a JS AJAX request is detected, OR the response can include a `
Some message
<%= link_to "This result will still be within modal", some_link, data: { blacklight_modal: "preserve" } %>