aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/examples/address_book/index.erb
blob: 217d39075c954178ba0da4228c871094717ab507 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<h1>Address Book</h1>

<% if @people.empty? %>
  <p>No people in the address book yet</p>
<% else %>
  <table>
    <tr><th>Name</th><th>Email Address</th><th>Phone Number</th></tr>
  <% for person in @people %>
    <tr><td><%= person.name %></td><td><%= person.email_address %></td><td><%= person.phone_number %></td></tr>
  <% end %>
  </table>
<% end %>

<form action="create_person">
  <p>
    Name:<br />
    <input type="text" name="person[name]">
  </p>

  <p>
    Email address:<br />
    <input type="text" name="person[email_address]">
  </p>

  <p>
    Phone number:<br />
    <input type="text" name="person[phone_number]">
  </p>

  <p>
    <input type="submit" value="Create Person">
  </p>
</form>