I have the following code:
<% @recipe.instructions.each do |instruction| %>
<li><%= instruction %></li>
<% end %>
I get the following error: undefined method ‘each’ for #<String:0xa354eb8>
@recipe.instructions is defined as text
Please help!
Reese
Use
each_lineinstead ofeach.String#eachhas been removed in ruby 1.9,each_lineworks with all ruby versions.