質問編集履歴

1

追加

2020/09/26 03:06

投稿

tomato185
tomato185

スコア29

test CHANGED
File without changes
test CHANGED
@@ -101,3 +101,57 @@
101
101
 
102
102
 
103
103
  ```
104
+
105
+
106
+
107
+
108
+
109
+ ```ruby
110
+
111
+ users_controller.rb
112
+
113
+ def new
114
+
115
+ @user = User.new
116
+
117
+ end
118
+
119
+
120
+
121
+ def create
122
+
123
+ @user = User.new(user_params)
124
+
125
+ if @user.save
126
+
127
+ @user.send_activation_email
128
+
129
+ # UserMailer.account_activation(@user).deliver_now
130
+
131
+ flash[:info] = "Please check your email to activate your account."
132
+
133
+ redirect_to root_url
134
+
135
+ else
136
+
137
+ render "new"
138
+
139
+ end
140
+
141
+ end
142
+
143
+
144
+
145
+ private
146
+
147
+
148
+
149
+ def user_params
150
+
151
+ params.require(:user).permit(:last_name, :first_name, :email, :tel, :password, :password_confirmation )
152
+
153
+ end
154
+
155
+
156
+
157
+ ```