Created
January 7, 2015 18:19
-
-
Save meaganewaller/7f8f62cce8631f03cf74 to your computer and use it in GitHub Desktop.
bootstrap modal not working :(
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="modal-header"> | |
<!-- modal body & stuff goes here --> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def modal_action | |
respond_to do |format| | |
format.html | |
format.js | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= link_to "My Modal", modal_action_path, remote: true, 'data-target' => "#modal-window" %> | |
<!-- hidden div for modal --> | |
<div id="modal-window" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#modal-window").html("<%= j render("modal_action") %>"); | |
$("#modal-window").modal('show'); |
I don't see a <div class="modal-dialog">
or a <div class="modal-content">
anywhere in your HTML. Could that be the problem?
Which bootstrap version do you use?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
modal_action.js.erb
and click the "My Modal" link it gets printed to the console._modal_action.html.erb
partial it gets printed in the Rails console when I'm running the server so I know it's being rendered via themodal_action.js.erb
it just doesn't show up.Any ideas?
I used a few code examples to get going,