Commit a9a1b2b3 authored by Dominique Pascasio's avatar Dominique Pascasio

Dom

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