RoR中的和之间的差异
有什么区别
和
在RoR?
想想这样:
<% execute this code and display nothing %>
和
<%= execute this code and display the result in the view %>
所以,例如你可以这样做:
<% @values = ['eenie', 'menie', 'miney', 'mo' ] %> <% @values.each do |value| %> The current value is <%= value %>! <% end %>
<%= some code %>
将评估该语句并在视图中显示它。 <% some code %>
仅评估该语句。