<% 0.upto(10) do |i| %>
i is now <%= i %>
<% end %>

On Dec 30, 1:39 pm, webbieguy <[email protected]> wrote:
> Hi,
>
> I have a very simple problem. I am a newbie to rails and for the life
> of me can't figure out why a simple incrementing loop is not printing
> to screen correctly. I know this has to be something simple but can't
> find anything specific to my problem.
>
> <%=
> for i in 0..10 do
> puts "i is now #{i}"
> end
> %>
>
> Prints to screen "0..10" as opposed to what I want:
>
> 0
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
>
> Can someone help me with this very simple problem. I have tried
> until, .times, and while loops to no avail. So there must be some type
> of syntax magic I am missing.
>
> Thanks in advance,
> Justin

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to