Commit a9a1b2b3 authored by Dominique Pascasio's avatar Dominique Pascasio

Dom

parent ab36fe82
File added
File added
......@@ -9,7 +9,8 @@ class LogsController < ApplicationController
def create
car = CarLog.new
car.plate_number = params[:plate_number]
car.time_in = ::Time.zone ? ::Time.zone.now.to_datetime : ::Time.now.to_datetime
car.created = ::Time.zone ? ::Time.zone.now.to_datetime : ::Time.now.to_datetime
car.time_in = params[:time_in]
car.time_out = params[:time_out]
car.color = params[:color]
car.brand = params[:brand]
......
......@@ -2,6 +2,7 @@
<%= form_tag("/logs/create", method: "post") do %>
<input type="text" name="plate_number" placeholder="plate number"/><br>
<input type="time" name="time_in"/><br>
<input type="time" name="time_out"/><br>
<select name="color">
<option value="White">White</option>
......
......@@ -6,11 +6,13 @@
<% @CarLogs.each do |car| %>
<div class="col-md-3 well">
<li>
<%= "#{car.plate_number}" %><br>
<%= "#{car.time_in}" %><br>
<%= "#{car.time_out}" %><br>
<%= "#{car.color}" %><br>
<%= "#{car.brand}" %><br>
Plate: <%= "#{car.plate_number}" %><br>
ID: <%= "#{car.id}" %><br>
Created at: <%= "#{car.created}" %><br>
Time in: <%= "#{car.time_in}" %><br>
Time out: <%= "#{car.time_out}" %><br>
Color: <%= "#{car.color}" %><br>
Brand: <%= "#{car.brand}" %><br>
<a href="/logs/delete/<%= car.id%>">Delete</a>
</li>
</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