質問編集履歴

1

モデル、カラム、ログの追記

2021/07/14 07:21

投稿

maxi
maxi

スコア0

test CHANGED
File without changes
test CHANGED
@@ -200,6 +200,66 @@
200
200
 
201
201
  ```
202
202
 
203
+ ```model
204
+
205
+ class Campany < ApplicationRecord
206
+
207
+
208
+
209
+ has_many :campany_users
210
+
211
+ has_many :users, through: :campany_users
212
+
213
+ validates :name, presence: true
214
+
215
+ validates :code, presence: true
216
+
217
+
218
+
219
+ end
220
+
221
+ ```
222
+
223
+ ```table
224
+
225
+ create_table "campanies", force: :cascade do |t|
226
+
227
+ t.string "name"
228
+
229
+ t.string "code"
230
+
231
+ t.datetime "created_at", null: false
232
+
233
+ t.datetime "updated_at", null: false
234
+
235
+ end
236
+
237
+ ```
238
+
239
+ ```log
240
+
241
+ Started GET "/campanies/new?utf8=%E2%9C%93&authenticity_token=8OGnqKWkq07IxNVqajWFghxuJRdPphTleDMCUUsAPEBsdfNjiHj1q%2FgcSBNuSa1rm9VDxJnKnjFksbzWu3iRdA%3D%3D&campany%5Bname%5D=%E6%A0%AA%E5%BC%8F%E4%BC%9A%E7%A4%BE%E3%82%B5%E3%83%B3%E3%83%97%E3%83%AB&campany%5Bcode%5D=wGcDRsNr&commit=%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B" for 121.83.77.164 at 2021-07-14 07:16:01 +0000
242
+
243
+ Cannot render console from 121.83.77.164! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
244
+
245
+ Processing by CampaniesController#new as HTML
246
+
247
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"8OGnqKWkq07IxNVqajWFghxuJRdPphTleDMCUUsAPEBsdfNjiHj1q/gcSBNuSa1rm9VDxJnKnjFksbzWu3iRdA==", "campany"=>{"name"=>"株式会社サンプル", "code"=>"wGcDRsNr"}, "commit"=>"作成する"}
248
+
249
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
250
+
251
+ ↳ app/controllers/campanies_controller.rb:5
252
+
253
+ Rendering campanies/new.html.erb within layouts/application
254
+
255
+ Rendered campanies/new.html.erb within layouts/application (51.6ms)
256
+
257
+ Completed 200 OK in 118ms (Views: 114.2ms | ActiveRecord: 0.2ms)
258
+
259
+ ```
260
+
261
+
262
+
203
263
 
204
264
 
205
265
  ### 試したこと