【发布时间】:2011-10-26 07:35:07
【问题描述】:
我想做的是让它只输出视图本身,而忽略 Rails 通常认为的 HTML 中嵌入的 Ruby。
例如:
<div class="current">
<div class="question">
<h3 id="homework_name"><%= homework.name %><h3 id="due">Due <%= homework.due %></h3></h3>
<h2 class="title">The Question:</h2>
<p id="question_contents"class="contents"><%= current_question.contents</p>
</div>
<div class="answer">
<h2 class="title">Your Answer:</h2>
<textarea class="contents" id="student_answer"><%= current_question.answer %></textarea>
</div>
</div>
我希望 ActionView 模板处理程序忽略所有提及:
-
<%= homework.name %> -
<%= homework.due %> -
<%= current_question.contents %> <%= current_question.answer %>
更具体地说,它应该忽略任何以<% 开头并以%> 结尾的标签
如果您需要更多信息,请查看http://pastie.org/private/epsxnapldho6co2y0indg
【问题讨论】:
标签: markup ruby-on-rails-3.1 templating actionview