0
我正在關注如何創建一個帶有註釋和標籤的Ruby-on-Rails博客網站tutorial,並且已將我的工作放到https://github.com/khpeek/jumpstart-blogger/上。刪除表中的列
本教程的最後部分涉及允許作者創建用戶名和密碼。其中一個網頁是從「巫術」寶石作者的默認列表:
正如你所看到的,也有與「密碼」和「確認密碼」,我想空白列喜歡刪除。
該網頁的外觀是由app/views/authors/index.html.erb
,其內容
<p id="notice"><%= notice %></p>
<h1>Listing Authors</h1>
<table>
<thead>
<tr>
<th>Username</th>
<th>Email</th>
<th>Password</th>
<th>Password confirmation</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @authors.each do |author| %>
<tr>
<td><%= author.username %></td>
<td><%= author.email %></td>
<td><%= author.password %></td>
<td><%= author.password_confirmation %></td>
<td><%= link_to 'Show', author %></td>
<td><%= link_to 'Edit', edit_author_path(author) %></td>
<td><%= link_to 'Destroy', author, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Author', new_author_path %>
我的想法是,以行註釋掉
<th>Password</th>
<th>Password confirmation</th>
和
<td><%= author.password %></td>
<td><%= author.password_confirmation %></td>
但是,如果我統治做到這一點,一些文本被放置在主邊界框之外:
是否有可能從正在發生的事情錯在這裏,代碼的這個有限的部分告訴?
你是怎麼評論的代碼,你可以發佈您的代碼? – Kld