LoginSignup
1
0

More than 5 years have passed since last update.

Railsで1つのフォームで複数のモデルを登録・更新させる(NEST)

Last updated at Posted at 2018-01-05
cd /var/opt/data
rails new NestSample -d mysql

cd NestSample
rails db:create

rails g scaffold targetserver hostname:string os:string cpu:integer
rails g model disk serverid:integer partitionname:string size:integer

rails db:migrate

「Railsで1つのフォームで複数のモデルを登録・更新させる」
https://qiita.com/Tommy1218/items/6349d8d860c5982771ff

「【Rails】複数のレコードを作成する。modelの関係性によって異なるform_for / fields_forの使い方」
https://qiita.com/ftyabu/items/cae912b211e985d74d58

「【Rails初心者向け】モデル間の関連付け(アソシエーション)まとめ」
https://qiita.com/To_BB/items/47d2c7b1bc3513025d7b

「Active Record の基礎」
https://railsguides.jp/active_record_basics.html

「[初心者向け] Railsで関連するデータ(親子関係)を保存する方法あれこれ」
https://railsguides.jp/active_record_basics.html

https://qiita.com/Matsushin/items/4829e12da2834d6e386e
https://mikazuki.hatenablog.jp/entry/2016/03/26/040229
https://techmory.hateblo.jp/entry/171107-cocoon

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0