質問編集履歴
2
情報の追加2
test
CHANGED
File without changes
|
test
CHANGED
@@ -122,6 +122,26 @@
|
|
122
122
|
|
123
123
|
```
|
124
124
|
|
125
|
+
```inquiry.rb
|
126
|
+
|
127
|
+
class Inquiry < ApplicationRecord
|
128
|
+
|
129
|
+
include ActiveModel::Model
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
attr_accessor :name, :email, :message
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
validates :name, :presence => {:message => '名前を入力してください'}
|
138
|
+
|
139
|
+
validates :email, :presence => {:message => 'メールアドレスを入力してください'}
|
140
|
+
|
141
|
+
end
|
142
|
+
|
143
|
+
```
|
144
|
+
|
125
145
|
|
126
146
|
|
127
147
|
やったこと
|
1
情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -78,6 +78,50 @@
|
|
78
78
|
|
79
79
|
```
|
80
80
|
|
81
|
+
```receiveemailtexterb
|
82
|
+
|
83
|
+
Webサイトからお問い合わせがありました。
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
--------------------------
|
88
|
+
|
89
|
+
Name: <%= @inquiry.name %>
|
90
|
+
|
91
|
+
Email: <%= @inquiry.email %>
|
92
|
+
|
93
|
+
Message:
|
94
|
+
|
95
|
+
<%= @inquiry.message %>
|
96
|
+
|
97
|
+
--------------------------
|
98
|
+
|
99
|
+
```
|
100
|
+
|
101
|
+
```inquirymailerrb
|
102
|
+
|
103
|
+
class InquiryMailer < ActionMailer::Base
|
104
|
+
|
105
|
+
default from: "example@example.com"
|
106
|
+
|
107
|
+
default to: "example@example.com"
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
def received_email(inquiry)
|
112
|
+
|
113
|
+
@inquiry = inquiry
|
114
|
+
|
115
|
+
mail(:subject => 'お問い合わせを承りました')
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
end
|
122
|
+
|
123
|
+
```
|
124
|
+
|
81
125
|
|
82
126
|
|
83
127
|
やったこと
|