Skip to content
Open

A1: #279

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ GEM
nio4r (2.5.8)
nokogiri (1.13.8-arm64-darwin)
racc (~> 1.4)
nokogiri (1.13.8-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.8-x86_64-linux)
racc (~> 1.4)
public_suffix (5.0.0)
Expand Down Expand Up @@ -194,6 +196,8 @@ GEM
strscan (3.0.4)
tailwindcss-rails (2.0.12-arm64-darwin)
railties (>= 6.0.0)
tailwindcss-rails (2.0.12-x86_64-darwin)
railties (>= 6.0.0)
tailwindcss-rails (2.0.12-x86_64-linux)
railties (>= 6.0.0)
thor (1.2.1)
Expand Down Expand Up @@ -223,6 +227,7 @@ GEM

PLATFORMS
arm64-darwin-20
x86_64-darwin-23
x86_64-linux

DEPENDENCIES
Expand Down
7 changes: 7 additions & 0 deletions app/controllers/bikes_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class BikesController < ApplicationController

def index
@bikes = Bike.all.order(identifier: :asc)
end

end
3 changes: 3 additions & 0 deletions app/views/bikes/_row.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="record-row <%= cycle "odd", "even", name: "row-cycler" %> flexbox vertical stretch">
<%= bike.identifier %>: <%= bike.current_station_id %>
</div>
19 changes: 19 additions & 0 deletions app/views/bikes/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="page-section flexbox vertical stretch">
<div class="section-inner flexbox vertical stretch">
<div>
<a href="/stations">View Stations</a>
</div>
<div class="section-title">
Welcome to ValetBike Everyone!
</div>
<div class="flexbox vertical stretch">
<% if @bikes.present? %>
<%= render(partial: "bikes/row", collection: @bikes, as: :bike) %>
<% else %>
<div class="empty">
No bikes found.
</div>
<% end %>
</div>
</div>
</div>
5 changes: 4 additions & 1 deletion app/views/stations/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<div class="page-section flexbox vertical stretch">
<div class="section-inner flexbox vertical stretch">
<div>
<a href="/bikes">View Bikes</a>
</div>
<div class="section-title">
Welcome to ValetBike!
Welcome to ValetBike Everyone!
</div>
<div class="flexbox vertical stretch">
<% if @stations.present? %>
Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rails.application.routes.draw do
root to: "stations#index"
get "stations", to: "stations#index"
get "bikes", to: "bikes#index"
end
100 changes: 100 additions & 0 deletions notes/bike-data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3849,25,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3740,21,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7946,29,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (6242,22,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (6928,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (9543,30,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2459,32,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4949,25,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2576,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4647,25,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (6868,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4684,31,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3492,33,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3594,30,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4273,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (6908,21,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3176,29,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7169,27,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7938,26,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (5995,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4499,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (6813,31,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4329,27,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (9473,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (5378,29,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7872,31,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2008,31,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2351,22,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4729,31,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7165,21,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (1106,33,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (1372,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (6730,26,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2699,27,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (1366,31,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2596,21,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2663,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3780,27,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (5408,27,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (8564,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7022,22,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4503,27,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (6884,22,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4757,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (8702,22,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (5697,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3434,25,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3684,28,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7522,20,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (9824,26,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (8918,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3924,27,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (5335,26,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (8089,25,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (1886,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2525,24,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (9192,27,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (5460,25,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2253,30,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (5444,29,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7788,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4047,26,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3575,25,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (5741,32,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (9718,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7437,29,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (9348,28,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4292,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2165,26,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2612,21,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (5068,27,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (1028,22,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (9834,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2074,27,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (5111,21,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7907,20,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3994,23,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (5276,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7148,23,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (6862,31,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7865,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (1144,21,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3998,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (6669,26,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (9189,27,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7420,33,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (5224,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3047,28,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (9494,21,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (7680,21,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3422,27,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2209,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3622,32,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (2887,33,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (3075,29,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (6541,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (9557,30,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (1758,20,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4033,NULL,now(),now());
insert into bikes (identifier, current_station_id, created_at, updated_at) values (4683,31,now(),now());
14 changes: 14 additions & 0 deletions notes/station-data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
insert into stations (identifier, name, address, created_at, updated_at) values (21,'Florence Bank Station','19 Meadow Street Florence MA @ Lilly Library',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (24,'Florence Center','31 Main Street Florence MA',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (30,'Jackson Street','7A-7D Jackson Street Northampton MA',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (25,'Cooley Dickinson Health Care','51 Locust Street Northampton MA',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (29,'State St/Mass Central Rail Trail','State Street/Mass Central Rail Trail',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (33,'Northampton High School','380 Elm Street Northampton MA',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (20,'Village Hill/State Hospital','Village Hill/State Hospital',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (26,'John M Greene Hall/Smith College','1 Chapin Way Northampton MA @ John M. Greene Hall',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (23,'Forbes Library','20 West Street Northampton MA',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (27,'Pulaski Park/Downtown','274 Main Street Northampton MA at Pulaski Park',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (31,'Main Street/Court House','99 Main Street Northampton MA',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (28,'Northampton Train Station','Northampton Train Station',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (32,'Main Street/Bridge Street','1 Bridge Street Northampton MA',now(),now());
insert into stations (identifier, name, address, created_at, updated_at) values (22,'YMCA/Childs Park','YMCA/Childs Park',now(),now());