lk | update bike & report to use fixed_at instead of entry_date

This commit is contained in:
Louis Knapp
2016-07-17 12:35:13 -05:00
parent 898337a07e
commit 8a46a95678
4 changed files with 37 additions and 35 deletions
+3 -1
View File
@@ -45,6 +45,7 @@ class BikesController < ApplicationController
end
def update
if @bike.update(bike_params)
redirect_to @bike, notice: 'Bike was successfully updated.'
else
@@ -73,8 +74,9 @@ class BikesController < ApplicationController
end
def bike_params
params[:bike][:fixed_at] = DateTime.strptime(params[:bike][:fixed_at], "%m/%d/%Y") if params[:bike][:fixed_at]
params.require(:bike).permit(
:entry_date,
:fixed_at,
:brand,
:model,
:bike_type,