I like using the short RHS if/unless notiation for dynamic output of
conditionals. However I noticed a very odd issue and wondering if
someone can explain (or fix) it.

We have orders in our system that are marked as rebilling the original
code was outputing a small image for a rebilling order but I noticed
that the image was showing up for every row regardless, after some
playing around I was able to isolate it to wrapping the entire snippet
in brackets:

http://idisk.me.com/corey.martella/Public/Pictures/Skitch/RHS_if-20090813-100526.jpg

The code here is:

  %table
    %tr
      %th #
      %th Time
      %th State
      %th Site
      %th Affiliate
      %th Customer
      %th Items
      %th Total

    - for order in @orders
      %tr{:class => cycle(:odd, :even)}
        %td= link_to order.id, order
        %td= order.ordered_at.to_s :compact_with_seconds
        %td= order.state.humanize
        %td= order.site_dimension && order.site ? site_code_name_link
(order.site) : "No SITE!!"
        %td= affiliate_link(order.affiliate)
        %td= link_to h(order.customer.name), order.customer
        %td.number= order.line_items_count
        %td.number= number_to_currency order.total
        %td.nowrap
          / This always outputs
          ="without" if order.rebilling_order?
          / This outputs correctly
          =("with" if order.rebilling_order?)


Thanks in advance,

CM

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" 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/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to