Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

Railsのformのsubmitでbootstrapのモーダルを閉じる

More than 1 year has passed since last update.

formのsubmit部分にdata: { dismiss: "modal"}を追加する。

html.haml
= f.submit "小説を追加する", class: "btn btn-primary px-5 mx-auto d-block", data: { dismiss: "modal"}

!!!追記!!!

上記の方法だと。submitできていなかった。

この辺を参考にすれば良いかも?
https://qiita.com/magic_xyz/items/01f38814ea8b0907ba49

Kohei_Kishimoto0214
自分のWEBサービスを作って生きていきたいと 本気で考えています。
https://www.narou-osusume.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away