Commit d565c5be authored by Jasmine Principe's avatar Jasmine Principe

updatedhtml

parent e55a7bba
...@@ -22,4 +22,11 @@ class CarLogsController < ApplicationController ...@@ -22,4 +22,11 @@ class CarLogsController < ApplicationController
redirect_to("/car_logs") redirect_to("/car_logs")
end end
def delete
car_log_to_delete = CarLog.find(record.id)
car_log_to_delete.destroy!
end
end end
\ No newline at end of file
<h1>Add New Record</h1> <h1>Add New Record</h1>
<%= form_tag("/car_logs/create", method: "post") do %> <%= form_tag("/car_logs/create", method: "post") do %>
<label>Plate Number</label> <label>Plate Number</label>
<input type="text" name="plate_number"/> <input type="text" name="plate_number"/>
<div></div> <label>Time In:</label>
<input type="datetime-local" name="time_in"/>
<label>Time Out:</label> <label>Time Out:</label>
<input type="text" name="time_out"/> <input type="datetime-local" name="time_out"/>
<div></div>
<label>Color:</label> <label>Color:</label>
<select name="rate" class="u-full-width"> <select name="color" class="u-full-width">
<option value="" disabled="disabled" selected="selected">Select..</option> <option value="" disabled="disabled" selected="selected">Select..</option>
<option value="red">red</option> <option value="red">red</option>
<option value="white">white</option> <option value="white">white</option>
...@@ -19,9 +20,8 @@ ...@@ -19,9 +20,8 @@
<option value="black">black</option> <option value="black">black</option>
<option value="others">others</option> <option value="others">others</option>
</select> </select>
<div></div>
<label>Brand:</label> <label>Brand:</label>
<select name="rate" class="u-full-width"> <select name="brand" class="u-full-width">
<option value="" disabled="disabled" selected="selected">Select..</option> <option value="" disabled="disabled" selected="selected">Select..</option>
<option value="Honda">Honda</option> <option value="Honda">Honda</option>
<option value="Toyota">Toyota</option> <option value="Toyota">Toyota</option>
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
<option value="Audi">Audi</option> <option value="Audi">Audi</option>
<option value="Porsche">Porsche</option> <option value="Porsche">Porsche</option>
</select> </select>
<div></div>
<input type="submit" value="Save"/> <input type="submit" value="Save"/>
<% end %> <% end %>
......
<h1>Car Log Records</h1> <h1>Car Log Records</h1>
<center>
<%= form_tag("/car_logs", method: "get") do %> <%= form_tag("/car_logs", method: "get") do %>
<input type="text" name="q"> <input type="text" name="q">
<input type="submit" value="Search"> <input type="submit" value="Search">
...@@ -8,15 +8,14 @@ ...@@ -8,15 +8,14 @@
<hr> <hr>
<table> <table cellpadding="50">
<thead> <thead>
<td>ID</td> <th> ID </th>
<td>Plate Number</td> <th> Plate Number </th>
<td>Time In</td> <th> Time In </th>
<td>Time Out</td> <th> Time Out </th>
<td>Color</td> <th> Color </th>
<td>Brand</td> <th> Brand </th>
<td colspan="3"></td>
</thead> </thead>
<% @records.each do |record| %> <% @records.each do |record| %>
...@@ -31,7 +30,7 @@ ...@@ -31,7 +30,7 @@
<% end %> <% end %>
</table> </table>
</center>
<hr> <hr>
<a href="/create_new">Add New Record</a> <a href="/create_new">Add New Record</a>
<div></div> <div></div>
......
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