mirror of
https://github.com/fspc/bike-database.git
synced 2026-09-16 16:41:38 -04:00
Louis | Adding mark-as-sold button to bike edit page
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
.container
|
||||
%h1 Editing bike
|
||||
.row
|
||||
.col-sm-6
|
||||
%h1 Edit bike
|
||||
.col-sm-3.col-sm-offset-3
|
||||
=button_to "Mark as sold", {action: "mark_as_sold", id: @bike.id}, method: :patch, class: "btn btn-default"
|
||||
= render 'form'
|
||||
= link_to 'Show', @bike
|
||||
|
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
.container
|
||||
%h1 Bikes
|
||||
|
||||
= link_to ' + Log Bike', new_bike_path, class: "btn btn-default"
|
||||
%br
|
||||
|
||||
%h1 Unsold Bikes
|
||||
%table.table.table-striped.table-bordered.table-hover
|
||||
%thead
|
||||
%tr
|
||||
@@ -8,6 +11,21 @@
|
||||
%th Model
|
||||
%th
|
||||
%th
|
||||
%tbody
|
||||
- @unsold_bikes.each do |bike|
|
||||
%tr
|
||||
%td= bike.brand
|
||||
%td= bike.model
|
||||
%td= link_to 'Show', bike
|
||||
%td= link_to 'Edit', edit_bike_path(bike)
|
||||
|
||||
%h1 All Bikes
|
||||
%table.table.table-striped.table-bordered.table-hover
|
||||
%thead
|
||||
%tr
|
||||
%th Brand
|
||||
%th Model
|
||||
%th
|
||||
%th
|
||||
%tbody
|
||||
- @bikes.each do |bike|
|
||||
@@ -16,7 +34,4 @@
|
||||
%td= bike.model
|
||||
%td= link_to 'Show', bike
|
||||
%td= link_to 'Edit', edit_bike_path(bike)
|
||||
%td= link_to 'Destroy', bike, method: :delete, data: { confirm: 'Are you sure?' }
|
||||
|
||||
%br
|
||||
= link_to ' + Log Bike', new_bike_path, class: "btn btn-default"
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
.strong New Parts:
|
||||
=bike.new_parts
|
||||
.row
|
||||
.col-xs-6.col-xs-offset-6.small= "Log Number: " + bike.log_number.to_s
|
||||
.col-xs-9.col-xs-offset-3.small= "Log Number: " + bike.log_number.to_s
|
||||
|
||||
Reference in New Issue
Block a user