I'm trying to add a link to a checkbox in formtastic, using haml. It looks like formtastic removes all ruby/haml/html syntax from the text for the label or hint when it parses it.
That is, this doesn't work:
= f.input :terms, label: '=link_to \'Here\', path_to_link', hint: '=link_to \'Other Place\', path_to_other_link', as: :boolean
Is there anything that will other than writing another div outside of this input? Or am I going about this all wrong? I'm a rails/haml/formtastic noob.
if you use ' for string quotation, you're basically telling ruby not to parse that content.
try something like this instead:
= f.input :terms, label: link_to('Here', path_to_link), hint: link_to('Other place', path_to_other_link), as: :boolean
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