精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2006-09-22
这片文档有个例子代码有问题:
action[b]="/book/update/<%= @ book.id %>" 这里URL少了参数. <html> <head> <title>Edit book</title> </head> <body> <h1>Edit book</h1> <form action[b]="/book/update/<%= @ book.id %>" [/b]method="POST"> <input id="book_id" name="book[id]" size="30" type="hidden" value="<%= @ book.id %>" /> <p><b>Title</b><br> <input id="book_title" name="book[title]" size="30" type="text" value="<%= @book.title %>" /> </p> <p><b>Description</b><br> <input id="book_description" name="book[description]" size="30" type="text" value="<%= @book.description %>" /> </p> <p><b>Category:</b><br> <select name="book[category_id]"> <% @categories.each do |category| %> <option value="<%= category.id %>" <%= ' selected' if category.id == @book.category.id %>> <%= category.name %> </option> <% end %> </select></p> <input type="submit" value="Update" /> </form> <a href="/book/show/<%= @ book.id %>"> Show </a> | <a href="/book/list"> Back </a> </body> </html> |
|
返回顶楼 | |