I'll go ahead and answer this for anyone else lazy like myself...

%li[w] gives <li class='widget' id='widget_1'>

On Jul 7, 9:21 am, Josh <[email protected]> wrote:
> Sometimes I need to define a class or an ID based on some ruby
> object.  For example, say I'm building a list of Widgets and it is
> necessary to mark each LI with a unique ID.  I would do something like
> this:
>
> %ul
>   @widgets.each do |w|
>     %li{:id => "widget_#{w.id}"} Foo
>
> Is it possible to do this using some kind of inline notation:
>
> %li#widget_#{w.id}
>
> The same idea would apply to naming classes, although that may be
> significantly less useful.
--~--~---------~--~----~------------~-------~--~----~
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