質問編集履歴
1
users schema追加、create method追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -350,6 +350,78 @@
|
|
350
350
|
|
351
351
|
### 補足情報(FW/ツールのバージョンなど)
|
352
352
|
|
353
|
-
|
353
|
+
users schema
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
```ここに言語を入力
|
358
|
+
|
359
|
+
create_table "users", force: :cascade do |t|
|
360
|
+
|
361
|
+
t.string "email", default: "", null: false
|
362
|
+
|
363
|
+
t.string "encrypted_password", default: "", null: false
|
364
|
+
|
365
|
+
t.string "reset_password_token"
|
366
|
+
|
367
|
+
t.datetime "reset_password_sent_at"
|
368
|
+
|
369
|
+
t.datetime "remember_created_at"
|
370
|
+
|
371
|
+
t.datetime "created_at", null: false
|
372
|
+
|
373
|
+
t.datetime "updated_at", null: false
|
374
|
+
|
375
|
+
t.index ["email"], name: "index_users_on_email", unique: true
|
376
|
+
|
377
|
+
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
378
|
+
|
379
|
+
end
|
380
|
+
|
381
|
+
```
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
registrations_controller.rb
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
```ここに言語を入力
|
390
|
+
|
391
|
+
class Users::RegistrationsController < Devise::RegistrationsController
|
392
|
+
|
393
|
+
before_action :configure_sign_up_params, only: [:create]
|
394
|
+
|
395
|
+
# before_action :configure_account_update_params, only: [:update]
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
# GET /resource/sign_up
|
400
|
+
|
401
|
+
#def new
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
#end
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
# POST /resource
|
410
|
+
|
411
|
+
def create
|
412
|
+
|
413
|
+
if user.save
|
414
|
+
|
415
|
+
redirect_to new_g_infos_path(id: @user)
|
416
|
+
|
417
|
+
end
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
end
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
```
|
354
426
|
|
355
427
|
ここにより詳細な情報を記載してください。
|