------ art_22829_15590040.1148709599803
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
I am trying to iterate over a hash but it only displays '#' for my key.
I know this is not the case because it outputs the correct number of lines
based on how many keys I have. If it were trully '#' it would only print one
line.
Here is the code that is producing the output...
<% @payment.batch.each do|key,value| %>
<li><%=key%> -> <%=value%></li>
<% end %>
here is my output ...
- # -> 1
- # -> 1
Here is the code that builds the hash...
Controller...
def add_invoice
@payment = find_payment
@invoice = Invoice.find(params[:id])
@payment.add_invoice(@invoice)
end
def find_payment
session[:payment] ||= Payment.new
end
and the class....
class Payment
include Reloadable
attr_reader :batch
def initialize
@batch = {}
end
def add_invoice(invoice)
unless @batch[invoice]
@batch[invoice] = 1
end
end
end
TIA,
Paul
------ art_22829_15590040.1148709599803--