mirror of
https://github.com/fspc/bike-database.git
synced 2025-02-23 09:33:23 -05:00
lk | changes order of bikes and adds log bikes button to home page
This commit is contained in:
parent
2edbcb5bbf
commit
b480d7b405
@ -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")
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
%tbody
|
%tbody
|
||||||
- @unsold_bikes.each do |bike|
|
- @unsold_bikes.each do |bike|
|
||||||
%tr
|
%tr
|
||||||
%td= bike.brand
|
%td= bike.brand
|
||||||
%td= bike.model
|
%td= bike.model
|
||||||
%td= link_to 'Show', bike
|
%td= link_to 'Show', bike
|
||||||
%td= link_to 'Edit', edit_bike_path(bike)
|
%td= link_to 'Edit', edit_bike_path(bike)
|
||||||
@ -30,8 +30,8 @@
|
|||||||
%tbody
|
%tbody
|
||||||
- @bikes.each do |bike|
|
- @bikes.each do |bike|
|
||||||
%tr
|
%tr
|
||||||
%td= bike.brand
|
%td= bike.brand
|
||||||
%td= bike.model
|
%td= bike.model
|
||||||
%td= link_to 'Show', bike
|
%td= link_to 'Show', bike
|
||||||
%td= link_to 'Edit', edit_bike_path(bike)
|
%td= link_to 'Edit', edit_bike_path(bike)
|
||||||
|
|
||||||
|
@ -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
|
||||||
@ -15,7 +17,7 @@
|
|||||||
%br
|
%br
|
||||||
= link_to "Freecyclery Bikes Ready for Pickup", ready_for_pickup_path
|
= link_to "Freecyclery Bikes Ready for Pickup", ready_for_pickup_path
|
||||||
%br
|
%br
|
||||||
= link_to "Freecyclery Closed Applications", closed_applications_path
|
= link_to "Freecyclery Closed Applications", closed_applications_path
|
||||||
%br
|
%br
|
||||||
= link_to "Available Bikes", available_bikes_path
|
= link_to "Available Bikes", available_bikes_path
|
||||||
%h2 Reports
|
%h2 Reports
|
||||||
|
Loading…
x
Reference in New Issue
Block a user