I think you've stumbled into a quagmire there with the changes to hashes in
ruby 1.9
Personally I avoid nested hashes in haml and just use string keys and =>
syntax.
%a{ 'ui-sref' => 'foo', 'ui-sref-active' => 'bar' } Hi!
On Tuesday, March 10, 2015 at 10:40:10 AM UTC-5, Pierre MARTIN wrote:
>
> Hello,
>
> I've been using HAML extensively for a very long time, but am puzzled by
> something and i finally decided to ask.
>
> Let's say i want this:
> <a ng-repeat='foo' ng-class='bar'>Hi there!</a>
> This is easily translatable to HAML like this:
> %a{ ng: { repeat: 'foo', class: 'bar' } } Hi!
>
> However, I find myself in an awkward situation when i have to translate
> something like this:
> <a ui-sref='foo' ui-sref-active='bar'>Hi!</a>
> The only solution i have found so far is this, and i'm really not happy
> with it:
> %a{ 'ui-sref'=>'foo', 'ui-sref-active'=>'bar' } Hi!
>
> How would one model this very example with clean hashy syntax using HAML
> please? Is there an way to tell HAML to use something as our "anonymous"
> hash top-level value, eg:
> %a{ ui: { sref: { special_sym: 'foo', active: 'bar' } } } Hi!
>
> I have tried this:
> %a{ ui: { sref: { ''=>'foo', active: 'bar' } } } Hi!
> But it generates this:
> <a ui-sref-='foo', ui-sref-active='bar'>Hi!</a>
>
> How do you guys accommodate with this problem? Is there anything wrong in
> my approach / why?
>
> Thanks!
> Pierre.
>
>
--
You received this message because you are subscribed to the Google Groups
"Haml" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/haml.
For more options, visit https://groups.google.com/d/optout.