Browse Source

lk | changes order of bikes and adds log bikes button to home page

master
Louis Knapp 9 years ago
parent
commit
b480d7b405
  1. 2
      app/controllers/bikes_controller.rb
  2. 2
      app/views/static_pages/home.html.haml

2
app/controllers/bikes_controller.rb

@ -3,7 +3,7 @@ class BikesController < ApplicationController
before_action :authenticate_user! before_action :authenticate_user!
def index def index
@bikes = Bike.all @bikes = Bike.all.order(:log_number).reverse_order
@unsold_bikes = @bikes.select{ |bike| @unsold_bikes = @bikes.select{ |bike|
!bike.date_sold && !bike.date_sold &&
(bike.purpose == "Sale") (bike.purpose == "Sale")

2
app/views/static_pages/home.html.haml

@ -3,6 +3,8 @@
%br %br
%h2 Bikes %h2 Bikes
%br %br
= link_to "Log Bikes", new_bike_path
%br
= link_to "View All Bikes", bikes_path = link_to "View All Bikes", bikes_path
%br %br
= link_to "Print Sale Bike Labels", print_select_bikes_path = link_to "Print Sale Bike Labels", print_select_bikes_path

Loading…
Cancel
Save