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

質問編集履歴

1

viewページの掲載

2020/04/08 12:46

投稿

tomohiro2525
tomohiro2525

スコア12

title CHANGED
File without changes
body CHANGED
@@ -1,5 +1,7 @@
1
1
  ユーザー情報更新後のページ遷移がうまくいきません。
2
2
  エラーにはルーティングエラーが表示されます。
3
+ ユーザー登録の変更のViewページは正しく表示されます。
4
+ データベースへの反映もされない状況です。
3
5
  どなたかご指導願います。
4
6
 
5
7
  ```
@@ -65,6 +67,70 @@
65
67
  ```
66
68
 
67
69
  ```
70
+ <div class="text-center">
71
+ <h2>ユーザー情報の変更</h2>
72
+ </div>
73
+ <br>
74
+
75
+ <div class="row">
76
+ <div class="col-sm-6 offset-sm-3">
77
+
78
+ <%= form_with(model: @user, local: true) do |f| %>
79
+ <%= render 'layouts/error_messages', model: f.object %>
80
+ <%# エラーメッセージ %>
81
+
82
+ <div class="form-group">
83
+ <%= f.label :name, 'ユーザー名' %>
84
+ <%= f.text_field :name, class: 'form-control' %>
85
+ </div>
86
+
87
+ <div class="form-group">
88
+ <%= f.label :email, 'メールアドレス' %>
89
+ <%= f.text_field :email, class: 'form-control' %>
90
+ </div>
91
+
92
+ <div class="form-group">
93
+ <%= f.label :password, 'パスワード' %>
94
+ <%= f.text_field :password, class: 'form-control' %>
95
+ </div>
96
+
97
+ <div class="form-group">
98
+ <%= f.label :password_confirmation, 'パスワード(確認用)' %>
99
+ <%= f.text_field :password_confirmation, class: 'form-control' %>
100
+ </div>
101
+
102
+ <div class="form-group">
103
+ <%= f.label :age, '年齢' %>
104
+ <%= f.text_field :age, class: 'form-control' %>
105
+ </div>
106
+
107
+ <div class="form-group">
108
+ <%= f.label :gender, '性別' %>
109
+ <%= f.text_field :gender, class: 'form-control' %>
110
+ </div>
111
+
112
+ <div class="form-group">
113
+ <%= f.label :month_income, 'おおよそ月収' %>
114
+ <%= f.text_field :month_income, class: 'form-control' %>
115
+ </div>
116
+
117
+ <div class="form-group">
118
+ <%= f.label :hobby, '趣味' %>
119
+ <%= f.text_field :hobby, class: 'form-control' %>
120
+ </div>
121
+
122
+ <div class="form-group">
123
+ <%= f.label :special_notes, 'その他特記事項' %>
124
+ <%= f.text_field :special_notes, class: 'form-control' %>
125
+ </div>
126
+
127
+ <%= f.submit '変更を登録する', class: 'btn btn-primary btn-block' %>
128
+ <% end %>
129
+ </div>
130
+ </div>
131
+ ```
132
+
133
+ ```
68
134
  Rails.application.routes.draw do
69
135
  root to: 'sessions#new'
70
136