Browse Source

Added bike show and show view

denney-fix-saving-dates
Jason Denney 10 years ago
parent
commit
c6a3ed9991
  1. 4
      app/controllers/bikes_controller.rb
  2. 25
      app/views/bikes/show.html.haml

4
app/controllers/bikes_controller.rb

@ -7,4 +7,8 @@ class BikesController < AuthenticatedController
@wheel_sizes.unshift( ["Select a wheel size", -1] )
end
def show
@bike = Bike.find_by_id(params[:id])
end
end

25
app/views/bikes/show.html.haml

@ -1 +1,24 @@
Bike Show
%h2 #{@bike.shop_id}: #{@bike.bike_brand} - #{@bike.model}
%dl.dl-horizontal
%dt Shop ID
%dd #{@bike.shop_id}
%dt Brand
%dd #{@bike.bike_brand}
%dt Model
%dd #{@bike.model}
%dt Type
%dd #{@bike.bike_style}
%dt Wheel Size
%dd #{@bike.bike_wheel_size.display_string}
%dt Condition
%dd #{@bike.bike_condition}
%dt Seat Tube (cm)
%dd #{@bike.seat_tube_height}
%dt Purpose
%dd #{@bike.bike_purpose}
%dt Value
%dd #{@bike.value}
- if !@bike.color.nil?
%dt Color
%dd{ style: "background-color: ##{@bike.color}; border: black; border-width: 1px; border-style: solid;"} #{@bike.color}

Loading…
Cancel
Save