質問編集履歴

1

モデルのコード追加

2019/12/16 15:45

投稿

NakaShun_1129
NakaShun_1129

スコア20

test CHANGED
File without changes
test CHANGED
@@ -119,3 +119,21 @@
119
119
  end
120
120
 
121
121
  ```
122
+
123
+ ```model
124
+
125
+ class Post < ApplicationRecord
126
+
127
+ belongs_to :user
128
+
129
+ validates :title, :body, presence: true
130
+
131
+
132
+
133
+ mount_uploader :image, ImageUploader
134
+
135
+ end
136
+
137
+
138
+
139
+ ```