|
@ -3,26 +3,24 @@ class BikesController < ApplicationController |
|
|
before_action :authenticate_user! |
|
|
before_action :authenticate_user! |
|
|
|
|
|
|
|
|
def index |
|
|
def index |
|
|
@bikes = Bike.all.order(:log_number).reverse_order |
|
|
@bikes = Bike.all.order(:log_number).reverse_order.paginate(:page => params[:page], :per_page => 30) |
|
|
@unsold_bikes = @bikes.select{ |bike| |
|
|
@unsold_bikes = @bikes.select{ |bike| |
|
|
!bike.date_sold && |
|
|
!bike.date_sold && |
|
|
(bike.purpose == "Sale") |
|
|
(bike.purpose == "Sale") |
|
|
} |
|
|
} |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def show |
|
|
def show; end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def new |
|
|
def new |
|
|
@bike = Bike.new |
|
|
@bike = Bike.new |
|
|
@log_number = Bike.order(:log_number).last.log_number + 1 |
|
|
@log_number = Bike.order(:log_number).last.log_number + 1 |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def edit |
|
|
def edit; end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def print_select |
|
|
def print_select |
|
|
@bikes = Bike.all |
|
|
@bikes = Bike.order(:log_number).reverse_order.paginate(:page => params[:page], :per_page => 30) |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def print_labels |
|
|
def print_labels |
|
|