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

質問編集履歴

1

追記の依頼

2016/11/08 23:49

投稿

fkryu
fkryu

スコア31

title CHANGED
File without changes
body CHANGED
@@ -35,8 +35,69 @@
35
35
  end
36
36
 
37
37
  ```
38
+ new.html.erb
39
+ ```<%= form_for(@require) do |f| %>
40
+ <% if @require.errors.any? %>
41
+ <div id="error_explanation">
42
+ <h2><%= pluralize(@require.errors.count, "error") %> prohibited this require from being saved:</h2>
38
43
 
44
+ <ul>
45
+ <% @require.errors.full_messages.each do |message| %>
46
+ <li><%= message %></li>
47
+ <% end %>
48
+ </ul>
49
+ </div>
50
+ <% end %>
39
51
 
52
+ <div class="field">
53
+ <%= f.label :name %><br>
54
+ <%= f.text_field :name %>
55
+ </div>
56
+ <div class="field">
57
+ <%= f.label :tel %><br>
58
+ <%= f.text_field :tel %>
59
+ </div>
60
+ <div class="field">
61
+ <%= f.label :email %><br>
62
+ <%= f.text_field :email %>
63
+ </div>
64
+ <div class="field">
65
+ <%= f.label :require_date %><br>
66
+ <%= f.date_select :require_date %>
67
+ </div>
68
+ <div class="field">
69
+ <%= f.label :require_time %><br>
70
+ <%= f.time_select :require_time %>
71
+ </div>
72
+ <div class="field">
73
+ <%= f.label :gender %><br>
74
+ <%= f.text_field :gender %>
75
+ </div>
76
+ <div class="field">
77
+ <%= f.label :age %><br>
78
+ <%= f.text_field :age %>
79
+ </div>
80
+ <div class="field">
81
+ <%= f.label :occupation %><br>
82
+ <%= f.text_field :occupation %>
83
+ </div>
84
+ <div class="actions">
85
+ <%= f.submit %>
86
+ </div>
87
+ <% end %>
88
+ ```
89
+
90
+
91
+ find.html.erb
92
+ ```
93
+ <div class = "buildingpage-right">
94
+
95
+ <div class = "requireSelect">
96
+ <%= link_to "問い合わせページ", new_require_path(@building) %>
97
+ ```
98
+
40
99
  ###補足情報(言語/FW/ツール等のバージョンなど)
41
100
  buildingモデルはuserモデルとも紐付けされています。そちらはcurrent_userが使えるのでusr_idを反映させることができているのですが、、、
42
- 初心者ですがどうぞよろしくお願いします。
101
+ 初心者ですがどうぞよろしくお願いします。
102
+
103
+ viewを追記致しました。よろしくお願いいたします。