Thanks, Mislav.
I think I see your problem. You have this snippet in RHTML:
<% if cart_item == @current_item %>
<tr id="current_item">
<% else %>
<tr>
<% end %>
which you're translating to this in Haml:
- if cart_item == @current_item
%tr#current_item
- else
%tr
However, this doesn't have the same effect. In RHTML, you're only
creating the opening tags; in Haml, you're creating the entire tag.
Thus, if cart_item == @current_item, all that's generated is
<tr id="current_item"></tr>
The proper way to do this is to dynamically set the id attribute:
%tr{:id => cart_item == @current_item ? 'current_item' : nil }
I also took the liberty of neatening up your Haml, and moving some code
into helpers: http://pastie.caboo.se/74323
Hope that helps!
- Nathan
Mislav Marohnić wrote:
> I took the liberty of pasting it: http://pastie.caboo.se/74318
> Sorry, but reading code from email is impossible.
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---