|
@ -18,30 +18,24 @@ class BikesController < ApplicationController |
|
|
|
|
|
|
|
|
def create |
|
|
def create |
|
|
@bike = Bike.new(bike_params) |
|
|
@bike = Bike.new(bike_params) |
|
|
respond_to do |format| |
|
|
|
|
|
if @bike.save |
|
|
if @bike.save |
|
|
format.html { redirect_to @bike, notice: 'Bike was successfully created.' } |
|
|
redirect_to @bike, notice: 'Bike was successfully created.' |
|
|
else |
|
|
else |
|
|
format.html { render action: 'new' } |
|
|
render action: 'new' |
|
|
end |
|
|
|
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def update |
|
|
def update |
|
|
respond_to do |format| |
|
|
|
|
|
if @bike.update(bike_params) |
|
|
if @bike.update(bike_params) |
|
|
format.html { redirect_to @bike, notice: 'Bike was successfully updated.' } |
|
|
redirect_to @bike, notice: 'Bike was successfully updated.' |
|
|
else |
|
|
else |
|
|
format.html { render action: 'edit' } |
|
|
render action: 'edit' |
|
|
end |
|
|
|
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def destroy |
|
|
def destroy |
|
|
@bike.destroy |
|
|
@bike.destroy |
|
|
respond_to do |format| |
|
|
redirect_to bikes_url |
|
|
format.html { redirect_to bikes_url } |
|
|
|
|
|
end |
|
|
|
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
private |
|
|
private |
|
@ -56,7 +50,6 @@ class BikesController < ApplicationController |
|
|
:model, |
|
|
:model, |
|
|
:bike_type, |
|
|
:bike_type, |
|
|
:color, |
|
|
:color, |
|
|
:frame_size, |
|
|
|
|
|
:log_number, |
|
|
:log_number, |
|
|
:purpose, |
|
|
:purpose, |
|
|
:serial_number, |
|
|
:serial_number, |
|
|