Haml in Padrino...

75 views
Skip to first unread message

SoldierCoder

unread,
May 25, 2012, 12:34:33 PM5/25/12
to ha...@googlegroups.com
Ok, I am trying to render a simple link in haml in a Padrino/Sinatra app.

the link, as html is:

<a href='/auth/twitter'>Sign in with Twitter</a>

my attempt in haml is:

%a(:href =>'/auth/twitter')Sign in with Twitter

but since i am trying to render inline i have to enclose it in quote like 
render :haml,  "%a(:href => 'auth/twitter') Sign in now with Twitter"

and that blows up in my face.  Any thoughts?



Norman Clarke

unread,
May 29, 2012, 7:02:19 PM5/29/12
to ha...@googlegroups.com
You need to use either the HTML-style attributes:

%a(href='auth/twitter')

or the Ruby ones:

%a{:href => 'auth/twitter'}

You've just got them a little crossed up. Fix that and you'll be fine.




--
You received this message because you are subscribed to the Google Groups "Haml" group.
To view this discussion on the web visit https://groups.google.com/d/msg/haml/-/8vsno_owwwQJ.
To post to this group, send email to ha...@googlegroups.com.
To unsubscribe from this group, send email to haml+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply all
Reply to author
Forward
0 new messages