Commit 69a01a7f authored by Czar Emmanuel Mejia's avatar Czar Emmanuel Mejia

Czar Emmanuel Mejia Rupert Ed D. Bana

parent 502e3121
......@@ -11,12 +11,14 @@ class CarLogsController < ApplicationController
plate_number = params[:plate_number]
brand = params[:brand]
slot_number = params[:slot_number]
is_taken = params[:is_taken]
if !plate_number.empty? && !brand.empty? && !slot_number.empty?
if !plate_number.empty? && !brand.empty? && !slot_number.empty? &&!is_taken.empty?
newcarlog = CarLog.new
newcarlog.plate_number = plate_number
newcarlog.brand = brand
newcarlog.slot_number = slot_number
newcarlog.is_taken = is_taken
newcarlog.save
redirect_to '/car_logs'
......
......@@ -56,6 +56,11 @@
<label for="slot_number" class="sr-only">Slot Number</label>
<input type="text" name="slot_number" id="slot_number" class="form-control" placeholder="Slot Number">
<!-- IS TAKEN -->
<label for="is_taken" class="sr-only">Is Taken</label>
<p>Is Taken?</p>
<input type="radio" name="is_taken" value=true checked> Yes<br>
<input type="radio" name="is_taken" value=false> No
<!--SUBMIT-->
<input class="btn btn-lg btn-info btn-block" type="submit" value="Add"></input>
<% end %>
......
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