I've got the following haml-code in one of my templates:
%b= t ('activerecord.attributes.exercise.title') + ':'
Is there a more elegant way to achieve this? Preferrably as oneliner and without the brackets.
The solution I like to use is Haml’s surround, succeed, and precede helpers:
= surround '(', ')' do
= link_to 'available here', foo_path
= precede '*' do
= link_to 'source', foo_path
= succeed ':' do
= link_to 'foo', foo_path
Text following link
Then it’s just typing/pasting a line before the helper and indenting the helper.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With