In my Rails template, I\'d like to accomplish final HTML to this effect using HAML:
I will first link somewhere
A better way to do this has been introduced via Haml's helpers:
= surround '(', ')' do
%a{:href => "food"} chicken
Produces:
(chicken)
click
= succeed '.' do
%a{:href=>"thing"} here
Produces:
click
here.
= precede '*' do
%span.small Not really
Produces:
*Not really
I will first
= succeed ',' do
= link_to 'link somewhere', 'http://example.com'
- if @condition
then render this half of the sentence if a condition is met
Produces:
I will first
link somewhere,
then render this half of the sentence if a condition is met