Commit 5f5e42da authored by Galen Evilla's avatar Galen Evilla

bootstrap additions

parents 5cd59577 f29f6e6f
...@@ -28,9 +28,11 @@ class CarLogsController < ApplicationController ...@@ -28,9 +28,11 @@ class CarLogsController < ApplicationController
def delete def delete
car_log_to_delete = CarLog.find(record.id) id = params[:id]
car_log_to_delete.destroy! @records = CarLog.find(id.to_i)
@records.destroy
redirect_to("/car_logs")
end end
end end
\ No newline at end of file
...@@ -10,9 +10,35 @@ ...@@ -10,9 +10,35 @@
<input type="text" name="q"> <input type="text" name="q">
<input type="submit" value="Search"> <input type="submit" value="Search">
<<<<<<< HEAD
<% end %> <% end %>
<hr> <hr>
=======
<table border="1">
<tr>
<th> ID </th>
<th> Plate Number </th>
<th> Time In </th>
<th> Time Out </th>
<th> Color </th>
<th> Brand </th>
<th> </th>
</tr>
<% @records.each do |record| %>
<tr>
<td><%= record.id %></td>
<td><%= record.plate_number %></td>
<td><%= record.time_in %></td>
<td><%= record.time_out %></td>
<td><%= record.color %></td>
<td><%= record.brand %></td>
<td><a href="car_logs/delete/<%= record.id %>">Delete </a></td>
</tr>
<% end %>
</table>
>>>>>>> f29f6e6f3bad719145aa72a906ddf1f42183c4fe
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<thead> <thead>
......
...@@ -5,5 +5,6 @@ Rails.application.routes.draw do ...@@ -5,5 +5,6 @@ Rails.application.routes.draw do
get "/car_logs", to: "car_logs#index", as: :carlogs get "/car_logs", to: "car_logs#index", as: :carlogs
get "/create_new", to: "car_logs#create_page" get "/create_new", to: "car_logs#create_page"
post "/car_logs/create", to: "car_logs#create" post "/car_logs/create", to: "car_logs#create"
get "/car_logs/delete/:id", to: "car_logs#delete"
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment