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