Skip to content

Commit 9c70d2f

Browse files
committed
Update UI add nav bar
1 parent 89be951 commit 9c70d2f

File tree

4 files changed

+38
-25
lines changed

4 files changed

+38
-25
lines changed

source/app/views/charges/_charges.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<table class="table <%= title.downcase %>">
44
<thead>
55
<tr>
6-
<th>Customer</th>
6+
<th>Customer Name</th>
77
<th>Amount</th>
88
<th>Date</th>
99
</tr>
Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
<p id="notice"><%= notice %></p>
2+
<div class="container">
3+
<h1>Listing Customers</h1>
24

3-
<h1>Listing Customers</h1>
4-
5-
<table>
6-
<thead>
7-
<tr>
8-
<th>First name</th>
9-
<th>Last name</th>
10-
<th colspan="3"></th>
11-
</tr>
12-
</thead>
13-
14-
<tbody>
15-
<% @customers.each do |customer| %>
5+
<table class="table">
6+
<thead>
167
<tr>
17-
<td><%= customer.first_name %></td>
18-
<td><%= customer.last_name %></td>
19-
<td><%= link_to 'Show', customer %></td>
20-
<td><%= link_to 'Edit', edit_customer_path(customer) %></td>
21-
<td><%= link_to 'Destroy', customer, method: :delete, data: { confirm: 'Are you sure?' } %></td>
8+
<th>First name</th>
9+
<th>Last name</th>
10+
<th colspan="3"></th>
2211
</tr>
23-
<% end %>
24-
</tbody>
25-
</table>
12+
</thead>
13+
14+
<tbody>
15+
<% @customers.each do |customer| %>
16+
<tr>
17+
<td><%= customer.first_name %></td>
18+
<td><%= customer.last_name %></td>
19+
<td><%= link_to 'Show', customer %></td>
20+
<td><%= link_to 'Edit', edit_customer_path(customer) %></td>
21+
<td><%= link_to 'Destroy', customer, method: :delete, data: { confirm: 'Are you sure?' } %></td>
22+
</tr>
23+
<% end %>
24+
</tbody>
25+
</table>
2626

27-
<br>
27+
<br>
2828

29-
<%= link_to 'New Customer', new_customer_path %>
29+
<%= link_to 'New Customer', new_customer_path %>
30+
</div>

source/app/views/layouts/application.html.erb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,19 @@
77
<%= csrf_meta_tags %>
88
</head>
99
<body>
10+
<p class="notice"><%= notice %></p>
11+
<p class="alert"><%= alert %></p>
1012

13+
<header class="navbar navbar-inverse">
14+
<div class="navbar-class">
15+
<div class="container">
16+
<ul class="nav navbar-nav">
17+
<li><%=link_to "Customers", customers_path %></li>
18+
<li><%=link_to "Charges", charges_path %></li>
19+
</ul>
20+
</div>
21+
</div>
22+
</header>
1123
<%= yield %>
1224

1325
</body>

source/config/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# See how all your routes lay out with "rake routes".
66

77
# You can have the root of your site routed with "root"
8-
root 'customers#index'
8+
root 'charges#index'
99

1010
# Example of regular route:
1111
# get 'products/:id' => 'catalog#view'

0 commit comments

Comments
 (0)