Forum: Ruby on Rails ERB not omiting lines

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
525128e48ca2b4c7fb6176ea166fccfd?d=identicon&s=25 Eric G. (gotskill10)
on 2009-03-06 00:46
 According to numerous ERB tutorials, the following example:

  <%- [1,2,3].each do |x| -%>
  <%= x %>
  <%- end -%>


should output:

   1
   2
   3

Instead, it outputs:

   1

   2

   3

What am I doing wrong?
A82ba1167f4d4a8d1de63820e576a87f?d=identicon&s=25 Robby Russell (Guest)
on 2009-03-06 00:51
(Received via mailing list)
Try...

 <%= x -%>

On Thu, Mar 5, 2009 at 3:46 PM, Aryk Grosz
<rails-mailing-list@andreas-s.net> wrote:
>   1
>
> What am I doing wrong?
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>



--
Robby Russell
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting w/Ruby on Rails

http://planetargon.com/
http://robbyonrails.com/
http://twitter.com/planetargon
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]
525128e48ca2b4c7fb6176ea166fccfd?d=identicon&s=25 Eric G. (gotskill10)
on 2009-03-06 03:53
Nope, that didn't work. That actually causes that line to not show up.

Anybody else have any thoughts?

Aryk

Robby Russell wrote:
> Try...
>
>  <%= x -%>
>
> On Thu, Mar 5, 2009 at 3:46 PM, Aryk Grosz
> <rails-mailing-list@andreas-s.net> wrote:
>>   1
>>
>> What am I doing wrong?
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>> >
>>
>
>
>
> --
> Robby Russell
> Chief Evangelist, Partner
>
> PLANET ARGON, LLC
> design // development // hosting w/Ruby on Rails
>
> http://planetargon.com/
> http://robbyonrails.com/
> http://twitter.com/planetargon
> aim: planetargon
>
> +1 503 445 2457
> +1 877 55 ARGON [toll free]
> +1 815 642 4068 [fax]
This topic is locked and can not be replied to.