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

質問編集履歴

1

自分の実際のメールアドレスの記載をしてしまったため、そちらを省きました。

2020/06/18 02:44

投稿

Shunpei0217
Shunpei0217

スコア15

title CHANGED
File without changes
body CHANGED
@@ -10,33 +10,23 @@
10
10
  ▼お問い合わせフォームがあるhome.html.erb
11
11
  ```ruby
12
12
  <div class="contact-form-section">
13
- <%= form_with model: @contact, :url => home_confirm_path do |form| %>
13
+ <%= form_with model: @contact, :url => home_confirm_path do |form| %>
14
- <% if @contact.errors.any? %>
14
+ <% if @contact.errors.any? %>
15
- <div class="alert alert-warning">
15
+ <div class="alert alert-warning">
16
- <ul>
16
+ <ul>
17
- <% contact.errors.full_messages.each do |message| %>
17
+ <% contact.errors.full_messages.each do |message| %>
18
- <li><%= message %></li>
18
+ <li><%= message %></li>
19
- <% end %>
19
+ <% end %>
20
- </ul>
20
+ </ul>
21
- </div>
21
+ </div>
22
- <% end %>
22
+ <% end %>
23
- <%= form.email_field :email, :placeholder => "Email", class: "input-email" %>
23
+ <%= form.email_field :email, :placeholder => "Email", class: "input-email" %>
24
- <%= form.text_field :name, :placeholder => "Name", class: "input-name" %>
24
+ <%= form.text_field :name, :placeholder => "Name", class: "input-name" %>
25
- <%= form.text_field :subject, :placeholder => "Subject", class: "input-subject" %>
25
+ <%= form.text_field :subject, :placeholder => "Subject", class: "input-subject" %>
26
- <%= form.text_area :message, :placeholder => "Message...", class: "textarea-message" %>
26
+ <%= form.text_area :message, :placeholder => "Message...", class: "textarea-message" %>
27
- <%= form.submit "Confirm", class: "submit-send" %>
27
+ <%= form.submit "Confirm", class: "submit-send" %>
28
-
29
- <!----------下記htmlでのformタグ内容---------->
30
- <!--<form action="#" method="post">
31
- <input class="input-email" type="text" name="email" placeholder="Email*">
32
- <input class="input-name" type="text" name="name" placeholder="Name*">
33
- <input class="input-subject" type="text" name="subject" placeholder="Subject">
34
- <textarea class="textarea-message" name="message" placeholder="Message..."></textarea>
35
- <input type="hidden" name="tomail" value="iyasiken@gmail.com">
36
- <input class="submit-send" type="submit" value="SEND">
37
- </form>-->
38
- <% end %>
28
+ <% end %>
39
- </div>
29
+ </div>
40
30
  ```
41
31
 
42
32
  ▼router.rb