Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding image handling.

  • Loading branch information...
commit e565ecae492def9ed8cd229ce743504c984f7dce 1 parent 70f74e6
itp student authored
View
BIN  .DS_Store
Binary file not shown
View
2  views/cars.erb
@@ -3,7 +3,7 @@
<h2><%= car.carname %></h2>
<h3>by <%= car.name %></h3>
-<a href="/cars/<%= car.rfid %>"><img src="/<%= car.rfid %>.jpg" width= "300"></a>
+<a href="cars/<%= "%010d" % car.rfid %>"><img src="http://192.168.23.2/~itpstudent/images/Cars/<%= "%010d" % car.rfid %>.jpg" width= "300"></a>
<% end %>
View
2  views/races.erb
@@ -3,7 +3,7 @@
<br>
<% race.racings.all(:order=>[:duration.asc]).each do |racing| %>
<%= racing.car.carname %></br>
-<a href="/cars/<%= racing.car.rfid %>"><img src = "/<%= racing.car.rfid %>.jpg" width=100></a>
+<a href="/cars/<%= racing.car.rfid %>"><img src="http://192.168.23.2/~itpstudent/images/Cars/<%= "%010d" % racing.car.rfid %>.jpg" style="float: left;" width= "300"></a>
<br>
<h4>Time: <%= millisToTime(racing.duration) %>
<br>
View
3  views/racings.erb
@@ -1,8 +1,10 @@
<% count = 1 %>
<% @racings.each do |racing| %>
+<div style="width: 100%;">
<h1>
<%= count.to_s() + ". " %>
</h1>
+<a href="http://192.168.23.2/~itpstudent/images/Cars/<%= "%010d" % racing.car.rfid %>.jpg"><img src="http://192.168.23.2/~itpstudent/images/Cars/<%= "%010d" % racing.car.rfid %>.jpg" style="float: left;" width= "300"></a>
<% count = count + 1 %>
<h2>
<%= racing.car.carname %>
@@ -13,4 +15,5 @@ by <%= racing.car.name %>
<br>
during race: <%= racing.race.id %>
<br>
+</div>
<% end %>
View
2  views/single_car.erb
@@ -1,7 +1,9 @@
<h1><%= @this_car.carname %></h1>
+
<br>
<h3>by <%= @this_car.name %></h3>
+<img src="http://192.168.23.2/~itpstudent/images/Cars/<%= "%010d" % @this_car.rfid %>.jpg" style="float: left;" width= "300">
<br>
<br>
<h3>Races</h3>
Please sign in to comment.
Something went wrong with that request. Please try again.