I’m using a Bootstrap modal in a Rails app. I would like to close the modal in the view.
For instance Bootstrap documentation has:
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
I tried this:
<%= submit_tag 'Cancel', :type => :reset, :class => "btn btn-danger", :input_html => {data-dismiss="modal" aria-hidden="true"} %>
But, I get a syntax error.
I want to use the same technique to close the submit button.
I could close it in jquery, but I’d really like to close it in the form.
Thanks!
Your hash is malformed. Try this:
I believe you don’t even need the
:input_htmland can just use the inner hash values right away, like so: