How can I make simple_format not wrap the returned value in p tags?
simple_format "<span class="required">*</span>"
Probably not what you really wanted, but... I ended up doing this:
module ApplicationHelper
def nl2br s
split_paragraphs(sanitize(s, tags: [])).join('<br>').html_safe
end
end
UPD Or better this:
def nl2br s
sanitize(s, tags: []).gsub(/\n/, '<br>').html_safe
end
You can specify wrapper_tag
option.
simple_format 'Hello', {}, wrapper_tag: 'span'
This code will be:
<span>Hello</span>
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