mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update vehicles_controller.rb
This commit is contained in:
@@ -33,6 +33,7 @@ class VehiclesController < ApplicationController
|
|||||||
def create
|
def create
|
||||||
@vehicle = Vehicle.new(params[:vehicle])
|
@vehicle = Vehicle.new(params[:vehicle])
|
||||||
@vehicle.save!
|
@vehicle.save!
|
||||||
|
flash[:notice] = "New Vehicle Created"
|
||||||
redirect_to @vehicle
|
redirect_to @vehicle
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -73,9 +74,9 @@ class VehiclesController < ApplicationController
|
|||||||
v = Vehicle.find_by_id(params[:id])
|
v = Vehicle.find_by_id(params[:id])
|
||||||
if v?
|
if v?
|
||||||
v.destroy
|
v.destroy
|
||||||
flash.now[:notice] = "Vehicle deleted successfully"
|
flash[:notice] = "Vehicle deleted successfully"
|
||||||
else
|
else
|
||||||
flash.now[:error] = "No Vehicle Found"
|
flash[:error] = "No Vehicle Found"
|
||||||
end
|
end
|
||||||
redirect_to action: :index
|
redirect_to action: :index
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user