
###前提・実現したいこと
Bootstrap4でmodalの中にさらにmodalを立ち上げています。
二つ目のmodalが立ち上がった時にcloseボタンを押すと、一つ目も消えてしまいます。
別々に管理したいので、IDを元にjQueryで制御したいと考えているのですが、IDが固定のものではなくパラメータを伴っており、jQueryからどのように読み取ることができるか、分かりません。恐れ入りますが、教えて頂けますでしょうか。
###発生している問題・エラーメッセージ
<%= render 'modal_user_show', target: "user_show_address_modal_#{user.id}", user: user %> <div class="modal fade" id="<%= target %>" tabindex="-1" role="dialog"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content" > <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel"><%= t('.update_senders',:address_name => address.name) %></h4> </div> <div class="modal-body"> <%= user.name %> ここでさらにモーダルを起動している。 </div> <div class="modal-footer"> <button type="button" class="btn btn-default" > <p>close</p> </button> </div> </div> </div> </div>
###該当の部分
こんな感じに「閉じるボタン」が二つあると、二つ目(上の部分)を押すと両方閉じてしまいます。
###補足情報(言語/FW/ツール等のバージョンなど)
rails5
bootstrap4

