teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

4

コード追記

2020/08/02 08:33

投稿

_tonton_
_tonton_

スコア4

title CHANGED
File without changes
body CHANGED
@@ -56,4 +56,40 @@
56
56
  resources :posts
57
57
  resources :users, only:[:new, :show, :create]
58
58
  end
59
+ ```
60
+
61
+ #### 追記
62
+ - views/devise/registrations/new.html.haml
63
+ ```ruby
64
+ .contents-row
65
+ .container
66
+ %h2
67
+ Sign up!
68
+ = form_with model: @user, url: user_registration_path, id: 'new_user', class: 'new_user', local: true do |f|
69
+ = devise_error_messages!
70
+
71
+ .field
72
+ = f.label :name
73
+ %i (6文字以内)
74
+ .field__name
75
+ = f.text_field :name, autofocus: true, maxlength: "6"
76
+
77
+ .field
78
+ = f.label :email
79
+ .field__address
80
+ = f.email_field :email
81
+
82
+ .field
83
+ = f.label :password
84
+ %i (6文字以上)
85
+ .field__pass
86
+ = f.password_field :password, autocomplete: "off"
87
+
88
+ .field
89
+ = f.label :password_confirmation
90
+ .field__pass-confirmation
91
+ = f.password_field :password_confirmation, autocomplete: "off"
92
+
93
+ .actions
94
+ = f.submit "Sign up" , class: 'sign-btn'
59
95
  ```

3

コードの記述もれ

2020/08/02 08:33

投稿

_tonton_
_tonton_

スコア4

title CHANGED
File without changes
body CHANGED
@@ -54,6 +54,6 @@
54
54
  devise_for :users
55
55
  root "posts#index"
56
56
  resources :posts
57
- resources :users, only[:new, :show, :create]
57
+ resources :users, only:[:new, :show, :create]
58
58
  end
59
59
  ```

2

初心者アイコン付加

2020/08/02 08:16

投稿

_tonton_
_tonton_

スコア4

title CHANGED
@@ -1,1 +1,1 @@
1
- 「新規投稿」や「ログイン」画面に遷移できない
1
+ Rails「新規投稿」や「ログイン」画面に遷移できない
body CHANGED
File without changes

1

記載漏れ

2020/08/02 08:12

投稿

_tonton_
_tonton_

スコア4

title CHANGED
File without changes
body CHANGED
@@ -47,4 +47,13 @@
47
47
  - else
48
48
  = link_to "ログイン", "new_user_session_path", class: "post"
49
49
  = link_to "新規登録", "new_user_registration_path", class: "post"
50
+ ```
51
+ - routes.rb
52
+ ```ruby
53
+ Rails.application.routes.draw do
54
+ devise_for :users
55
+ root "posts#index"
56
+ resources :posts
57
+ resources :users, only[:new, :show, :create]
58
+ end
50
59
  ```