<div>不会显示在Ruby on Rails </div>中

时间:2013-11-23 13:54:13

标签: ruby-on-rails erb

显示第一个和第三个div,但第二个不会不惜任何代价显示,即使禁用了CSS。

<%= provide(:title, 'Ask a question')%>

<div id="ask">
  <h1>Ask a Question</h1>

  <% if logged_in? %>
    <%= render 'question_form' %>
  <% else %>
   <p>Please login to ask/or answer questions</p>

  <% end %>
</div><!-- end ask -- >


<div>
  <h2>Unsolved Questions</h2>
  <p>why this does not work</p>
  <% if @questions.any? %>
  <ul><% render @questions %></ul>
    <%= will_paginate %>
  <% else %>
     <p>No questions have been asked.</p>
  <% end %>
</div><!-- end questions-->

<div><p>test test</p></div>

1 个答案:

答案 0 :(得分:4)

<!-- end ask -- >

此处的HTML评论未正确终止。它应该是:

<!-- end ask -->

如果您检查问题的语法高亮,那么它应该会变得明显。