I have an object in a rails model that can either be a string or an array. In my view I have the following:
<% current_user.transaction[:account_name].each do |name| %>
If the object account_name is a string, then it throws an error.
I want to run something like this:
<% current_user.transaction[:account_name].each, if sting? each_line do |name| %>
using each_line if the object is a string, but using each if it is an array. I am not sure if this is the best solution. Any ways to make this work regardless of whether the object is an array or string?