Professional Documents
Culture Documents
HW
HW
- title: string
- author: string
create route in config/routes
get "/books/list" => "books/list"
go to app/views
create new folder books
under books create list.html.erb
go to list
<table border="2" style="width:450px">
<tr>
<td><big>Title<big></td>
<td><big>Author<big></td>
</tr>
<tr>
<td>A Brief History of Time</td>
<td>Stephen Hawking</td>
</tr>
<tr>
<td>Alice in Wonderland</td>
<td>Lewis Carroll</td>
</tr>
<tr>
<td>The Lord of the Rings</td>
<td>J.R.R Tolkien</td>
</tr>
<tr>
<td>The Hobbit</td>
<td>J.R.R Tolkien</td>
</tr>
</table>
go to the roll.html.erb
<% puts x = rand(5)+1 %>
<% puts y = rand(5)+1 %>
<img src = "http://kiei925.com/images/dice/<%= x %>.png"> <img src =
"http://kiei925.com/images/dice/<%= y %>.png">