我需要拆分一个字符串并从我的视图底部开始打印它。标准方式从头开始读取字符串并相应地打印。我该如何扭转它?
<% @a[:log].to_s.split(/----/).each do |line| %>
<div width='100%'><pre class="log"><%= "#{line}" %></pre></div>
<% end %>
@a[:log] is a string something like this: One ---- Two ---- Three ---- Four
I want this printed reverse starting from Four, instead of One.
<div width='100%'><pre class="log">Four</pre></div>
<div width='100%'><pre class="log">Three</pre></div>
<div width='100%'><pre class="log">Two</pre></div>
<div width='100%'><pre class="log">One</pre></div>