This project is archived and is in readonly mode.

#2588 ✓invalid
James B. Byrne

ActionMailer <% if -%> inside <% for -%>

Reported by James B. Byrne | April 30th, 2009 @ 08:30 PM | in 3.x

When using an <% if true -%> construct inside a <% for x in y -%> loop in an ActionMailer view template extra lines and spurious '=' characters are injected into the output.

<% if true -%>
  <%= "print this" %>
<% end -%>

<% for y in @x -%>
  <% if true -%>
    <%= "print this" %>
  <% end -%>
<% end -%>

gives this:

  print this

                                 print this

Comments and changes to this ticket

  • Ryan Bigg

    Ryan Bigg April 29th, 2010 @ 10:31 PM

    • State changed from “new” to “incomplete”

    This needs to be confirmed as a bug and a patch to be written if it is.

  • James B. Byrne

    James B. Byrne April 30th, 2010 @ 01:54 PM

    • Tag changed from 2.3.2, actionmailer, bug, template, view to 2, actionmailer, bug, template, view

    I am curious about the date that this issue claims to have been opened, 2010 April 29. As I recall, I reported this about a year ago but in any case it certainly was not yesterday.

  • James B. Byrne

    James B. Byrne April 30th, 2010 @ 03:49 PM

    I am going from memory here as I can no longer find my notes or email exchanges regarding this subject. Sic transit ephemera.

    As I recall, I did not consider that TMail includes all of the space found in the view template lines that get expressed when the variable is filled in. When the length of the resulting line exceeds 80 characters, or whatever the line limit is in TMail, the line is broken into two and wraps. The = character is what the mail reader displays for such breaks.

    So, I no longer consider this a bug as such, just a confusing intersection of coding and output.

  • Jeremy Kemper

    Jeremy Kemper May 4th, 2010 @ 06:48 PM

    • Milestone changed from 2.x to 3.x
  • Dan Pickett

    Dan Pickett May 9th, 2010 @ 06:09 PM

    • Assigned user set to “Ryan Bigg”

    based on the commentary above, this can be marked as "wontfix" or "invalid"

  • Ryan Bigg

    Ryan Bigg May 9th, 2010 @ 10:29 PM

    • State changed from “incomplete” to “invalid”
  • Andrea Campi

    Andrea Campi October 16th, 2010 @ 11:42 PM

    • Tag changed from 2, actionmailer, bug, template, view to actionmailer, bug, template, view
    • Importance changed from “” to “Low”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket