Commit d342d591 authored by Donna Dumaliang's avatar Donna Dumaliang

done

parent cc4f3cfc
......@@ -3,6 +3,12 @@ class CarLogsController < ApplicationController
@CarLogs = CarLog.all.paginate(:page => params[:page], :per_page => 8)
end
def deletestudent
id = params[:id]
@CarLogs = CarLog.find(id.to_i)
@CarLogs.destroy
redirect_to '/'
end
def addCarLog
......@@ -12,13 +18,14 @@ class CarLogsController < ApplicationController
plate_number= params[:inputPlateNumber]
brand = params[:inputBrand]
slot_number = params[:inputSlotNumber]
is_taken = params[:is_taken]
if !plate_number.empty? && !brand.empty?
newCarlog = CarLog.new
newCarlog.plate_number = plate_number
newCarlog.brand= brand
newCarlog.slot_number = slot_number
newCarlog.is_taken = true
newCarlog.is_taken = is_taken
newCarlog.save
......
<div class="container">
<form class="form-signin">
<h2 class="form-signin-heading">Please sign in</h2>
<label for="inputEmail" class="sr-only">Email address</label>
<input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" id="inputPassword" class="form-control" placeholder="Password" required>
<h2 class="form-signin-heading">Please Fill Up</h2>
<label for="inputPlateNumber" class="sr-only">Plate number</label>
<input type="text" id="inputPlateNumber" class="form-control" placeholder="Plate Number" required autofocus>
<label for="inputBrand" class="sr-only">Brand</label>
<select name="cars" id="inputBrand" class="form-control" placeholder="Brand">
<option value="volvo">Honda</option>
<option value="saab">Toyota</option>
<option value="fiat">Ford</option>
</select>
<label for="is_taken" class="sr-only">Is taken?</label>
<input type="radio" name="is_taken" value="yes" checked> Yes<br>
<input type="radio" name="gender" value="no"> No<br>
<div class="checkbox">
<label>
<input type="checkbox" value="remember-me"> Remember me
......
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