エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Rails5.1からのform_withでnested_formを扱う方法 - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Rails5.1からのform_withでnested_formを扱う方法 - Qiita
# Passing model: @post will 1) set scope: :post, 2) set url: url_for(@post) form_with(model: @pos... # Passing model: @post will 1) set scope: :post, 2) set url: url_for(@post) form_with(model: @post) do |form| form.text_field :title # Will reference @post.title as normal form.text_area :description, "Overwrite @post.description if present, if not, it will still work" form.submit end form_with(scope: :post, url: posts_path) do |form| form.text_field :title # post[title] form.text_area :descriptio

