mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 01:14:23 -05:00
Update vehicles_controller.rb
This commit is contained in:
@@ -42,10 +42,7 @@ class VehiclesController < ApplicationController
|
|||||||
# display a specific vehicle
|
# display a specific vehicle
|
||||||
def show
|
def show
|
||||||
@vehicle = Vehicle.find_by_id(params[:id])
|
@vehicle = Vehicle.find_by_id(params[:id])
|
||||||
if @vehicle
|
if not @vehicle
|
||||||
@customer = @vehicle.customer.name if @vehicle.customer
|
|
||||||
@issues = @vehicle.issues
|
|
||||||
else
|
|
||||||
flash[:error] = "Vehicle Not Found"
|
flash[:error] = "Vehicle Not Found"
|
||||||
redirect_to :index
|
redirect_to :index
|
||||||
end
|
end
|
||||||
@@ -54,7 +51,6 @@ class VehiclesController < ApplicationController
|
|||||||
# return an HTML form for editing a vehicle
|
# return an HTML form for editing a vehicle
|
||||||
def edit
|
def edit
|
||||||
@vehicle = Vehicle.find_by_id(params[:id])
|
@vehicle = Vehicle.find_by_id(params[:id])
|
||||||
@customer = @vehicle.customer.id if @vehicle.customer
|
|
||||||
@customers = Customer.all.order(:name)
|
@customers = Customer.all.order(:name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user