質問編集履歴

2

大変失礼致しました。ご指摘ありがとうございます。修正いたしました。

2019/07/21 12:36

投稿

kntarohh
kntarohh

スコア11

test CHANGED
File without changes
test CHANGED
@@ -132,25 +132,27 @@
132
132
 
133
133
  ```
134
134
 
135
- <h1>Sample App</h1>
135
+ class UserMailer < ApplicationMailer
136
-
137
-
138
-
139
- <p>Hi <%= @user.name %>,</p>
136
+
140
-
141
-
142
-
143
- <p>
144
-
145
- Welcome to the Sample App! Click on the link below to activate your account:
146
-
147
- </p>
148
-
149
-
150
-
151
- <%= link_to "Activate", edit_account_activation_url(@user.activation_token,
137
+ def account_activation(user)
138
+
152
-
139
+ @user = user
140
+
153
- email: @user.email) %>
141
+ mail to: user.email
142
+
143
+ end
144
+
145
+
146
+
147
+ def password_reset(user)
148
+
149
+ @user = user
150
+
151
+ mail to: user.email, subject: "Password reset"
152
+
153
+ end
154
+
155
+ end
154
156
 
155
157
  ```
156
158
 

1

routesファイル追記しました。よろしくお願いいたします。

2019/07/21 12:36

投稿

kntarohh
kntarohh

スコア11

test CHANGED
File without changes
test CHANGED
@@ -302,6 +302,56 @@
302
302
 
303
303
 
304
304
 
305
+ ### ★config/routes.rb
306
+
307
+ ```
308
+
309
+ Rails.application.routes.draw do
310
+
311
+
312
+
313
+ get 'password_resets/new'
314
+
315
+
316
+
317
+ get 'password_resets/edit'
318
+
319
+
320
+
321
+ get 'sessions/new'
322
+
323
+
324
+
325
+ root 'static_pages#home'
326
+
327
+ get '/help', to: 'static_pages#help'
328
+
329
+ get '/about', to: 'static_pages#about'
330
+
331
+ get '/contact', to: 'static_pages#contact'
332
+
333
+ get '/signup', to: 'users#new'
334
+
335
+ post '/signup', to: 'users#create'
336
+
337
+ get '/login', to: 'sessions#new'
338
+
339
+ post '/login', to: 'sessions#create'
340
+
341
+ delete '/logout', to: 'sessions#destroy'
342
+
343
+ resources :users
344
+
345
+ resources :account_activations, only: [:edit]
346
+
347
+ resources :password_resets, only: [:new, :create, :edit, :update]
348
+
349
+ end
350
+
351
+ ```
352
+
353
+
354
+
305
355
  ### 試したこと
306
356
 
307
357