So, the question is: as fixnum is not a string, how i display the amount of caipirinhas on the show?
If you iterate show this error:
private method `caipirinha' called for 0:Fixnum
New drink view
<%= d.label :caipiriha %><%= d.number_field :caipirinha %>
Show drink view
<% current_user.bar.caipirinha.times do |s| %>
<%= s.caipirinha %>
<% end %>
How about this:
You can use the
to_imethod to convertcaipirinhato an integer, then calltimeson it.