Forum: Ruby on Rails Unwanted empty lines in the resulting HTML files.

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.
A7736d622f35f8725cc9a0c835d633a3?d=identicon&s=25 Mathias Wittlock (Guest)
on 2007-01-27 06:54
(Received via mailing list)
Hey all,

I got a weird issue where my Ruby tags looking like this:
<% (something) -%>
actually produces empty lines once I put them on my webhost. Locally
while I develop I don't get them at all. This is really annoying as
the resulting HTML code looks really messed up.

I have frozen Rails, so it's the exact same Rails code being run
locally as well as in production. What might cause this problem? Known
bug? Is there any other way to stop if statements and ends to create
blank lines?

Thanks,
Mathias.
D51a24ae1017f53158d70b621494255d?d=identicon&s=25 Bontina Chen (abon)
on 2007-01-27 07:26
Mathias Wittlock wrote:
> Hey all,
>
> I got a weird issue where my Ruby tags looking like this:
> <% (something) -%>
> actually produces empty lines once I put them on my webhost. Locally
> while I develop I don't get them at all. This is really annoying as
> the resulting HTML code looks really messed up.
>
> I have frozen Rails, so it's the exact same Rails code being run
> locally as well as in production. What might cause this problem? Known
> bug? Is there any other way to stop if statements and ends to create
> blank lines?
>
> Thanks,
> Mathias.

Try %> instead of -%>

Abon
A7736d622f35f8725cc9a0c835d633a3?d=identicon&s=25 Mathias Wittlock (Guest)
on 2007-01-27 08:16
(Received via mailing list)
On 1/27/07, Bontina Chen <rails-mailing-list@andreas-s.net> wrote:
>
> Try %> instead of -%>
>
> Abon

I thought the dash would force that line to not produce any blank
lines. Isn't that the feature? I guess I'll try without it, can't
hurt. :)

Thanks,
Mathias.
A7736d622f35f8725cc9a0c835d633a3?d=identicon&s=25 Mathias Wittlock (Guest)
on 2007-01-27 08:28
(Received via mailing list)
On 1/27/07, Bontina Chen <rails-mailing-list@andreas-s.net> wrote:
>
> Try %> instead of -%>
>
> Abon

Just tried this and it made no difference.

I'm developing the project under Windows (in RadRails) and it is
deployed to a Linux server. Could it be some end-of-line delimiter
that's different between the OSes that's causing this bug? I can't be
the only one suffering from this?

Mathias.
70225136eacd3d870f64e03bff678655?d=identicon&s=25 Russell Norris (Guest)
on 2007-01-27 14:44
(Received via mailing list)
Yeah. I used to have this problem. I think it's definitely an issue with
Windows line-endings. I solved it by [ack] editing the files on the
server
[with pico/nano]. Now I develop on Linux so there's no issue. I don't
think.

RSL
A7736d622f35f8725cc9a0c835d633a3?d=identicon&s=25 Mathias Wittlock (Guest)
on 2007-01-28 03:07
(Received via mailing list)
On 1/27/07, Russell Norris <sconds@gmail.com> wrote:
> Yeah. I used to have this problem. I think it's definitely an issue with
> Windows line-endings. I solved it by [ack] editing the files on the server
> [with pico/nano]. Now I develop on Linux so there's no issue. I don't think.
>
> RSL

I looked into this a bit more and it seems like one problem is that if
you comment out the line, for example:
<% # if whatever? -%>
then it will still produce an empty line. But there were other places
where the problems disappeared once I started editing the files on the
server to try it out. So it might be a combination. Will keep it in
mind though, will help me with the trouble shooting if it happens
again.

Thanks,
Mathias.
This topic is locked and can not be replied to.