Files
nemo_encoder/app/views/clients/index.html.erb
2017-02-06 18:32:22 +06:30

53 lines
2.3 KiB
Plaintext

<div class="row ">
<nav class="breadcrumb">
<a class="breadcrumb-item active" href="<%= dashboard_path %>">Home</a>
<a class="breadcrumb-item active" href="#">Client</a>
</nav>
</div>
<div class="row top-content">
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")),new_client_path,:class => 'btn btn-primary' %>
</span>
</div>
<div class="row content">
<div class="card">
<div class="card-header">
<strong>Client List</strong>
</div>
<div class="card-block">
<table class="table" style="border-top:none">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Address</th>
<th>Product Type</th>
<th>Created At </th>
<th>Action</th>
</tr>
</thead>
<tbody>
<% @clients.each do |client| %>
<tr>
<td><%= client.name rescue '' %></td>
<td><%= client.email rescue '' %></td>
<td><%= client.phone rescue '' %></td>
<td><%= client.address rescue '' %></td>
<td><%= client.product_type rescue '' %></td>
<td><%= client.created_at.strftime("%e,%b %Y %I:%M %p") rescue '' %></td>
<td>
<%= link_to 'Detail',
client_path(client), :class => 'btn btn-primary btn-sm' %>
<%= link_to 'Edit',
edit_client_path(client), :class => 'btn btn-primary btn-sm' %>
<%= link_to 'Delete', clients_path(client), method: :delete, data: { confirm: 'Are you sure?' },:class => 'btn btn-primary btn-sm' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%=paginate @clients %>
</div>
</div>
</div>