This is an interesting note - in general, although

%foo[obj, :prefix]

is somewhat more elegant,

%foo{:id => :prefix, :class => :prefix}[obj]

is functionally equivalent. I had forgotten about that. I'm not sure 
it's worth adding new syntax for something that's not too painful to do 
without it.

- Nathan

Olek Poplavsky wrote:
> I needed similar functionality couple days ago, and I found that this 
> also worked for me with 1.8.2:
>
> %tr{ :id => 'sub', :class => cycle('even', 'odd') }[sub_channel]
>
> that resulted in output
>  
> <tr class='channel odd' id='sub_channel_97'>
>
> 'prefix' syntax is surely more elegant, I vote for it. My current 
> solution, on the other side allows using prefixes for id, but not for 
> class, which is desirable in this case.
>
> regards,
>   Olek
>
> On Apr 11, 2008, at 5:25 PM, Nathan Weizenbaum wrote:
>> Hey folks,
>>
>> Stefano Cobianchi forked Haml a couple days ago and added support for 
>> prefix arguments to the object-ref tag component. This means you can do
>>
>>   %p[post, :prefix]
>>
>> and this will generate
>>
>>   <p class='prefix_post' id='prefix_post_#{id}'>
>>
>> I've merged this into master tentatively. Try it out, let us know if 
>> it's useful. If it is, we'll keep it in, if not, we'll leave it out.
>>
>> - Nathan
>>
>>
>>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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