mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 08:54:23 -05:00
Update vehicles_controller.rb
This commit is contained in:
@@ -61,6 +61,7 @@ class VehiclesController < ApplicationController
|
||||
# update a specific vehicle
|
||||
def update
|
||||
@customer = params[:customer]
|
||||
begin
|
||||
@vehicle = Vehicle.find_by_id(params[:id])
|
||||
if @vehicle.update_attributes(params[:vehicle])
|
||||
flash[:notice] = "Vehicle updated"
|
||||
@@ -69,6 +70,9 @@ class VehiclesController < ApplicationController
|
||||
flash[:error] = @vehicle.errors.full_messages.to_sentence if @vehicle.errors
|
||||
redirect_to edit_vehicle_path
|
||||
end
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
end
|
||||
|
||||
# delete a specific vehicle
|
||||
|
||||
Reference in New Issue
Block a user