Professional Documents
Culture Documents
Mysql
Mysql
<body>
<p> Entered book id is <%= @bookid %> </p>
<table border=1>
<tr><th>Book Id</th><th>Book Name</th><th>Details </th> <th>Price
</th> </tr>
<% @bookz.each do |bk|
@id = bk.id
@name = bk.name
@descp = bk.description
@price = bk.price %>
<tr>
<td> <%= @id %></td>
</tr>
<% end %>
</table>
</form>
</body>
</html>
> notepad app\views\main\welcome.rhtml
<html>
<title> Welcome template for books </title>
<body>
<p> Total number of books = <%= @num_books %> </p>
<form action = "result" >
Enter Searching Element: <input type="text" name="sid" />
<input type=submit value="Search" />
</form>
</body>
</html>
ruby script/server
http://localhost:3000/main/welcome