Hello tinyforms
This commit is contained in:
5
app/views/forms/index.html.erb
Normal file
5
app/views/forms/index.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<%= link_to "new form", new_form_url %>
|
||||
<hr>
|
||||
<% @forms.each do |form| %>
|
||||
<%= link_to form.title, form_url(form) %>
|
||||
<% end %>
|
||||
5
app/views/forms/new.html.erb
Normal file
5
app/views/forms/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<%= form_for @form do |f| %>
|
||||
<%= f.text_field :title %>
|
||||
<%= f.text_field :thank_you_url %>
|
||||
<%= f.submit %>
|
||||
<% end %>
|
||||
18
app/views/forms/show.html.erb
Normal file
18
app/views/forms/show.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<% @form.header_values.each do |value| %>
|
||||
<th><%= value %></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @submissions.each do |submission| %>
|
||||
<tr>
|
||||
<% @form.header_values.each do |column| %>
|
||||
<td><%= submission.data[column] %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user