I have strings that use simple_format so they always have p tags surrounding them. I have some code to strip those surrounding p tags but I know there has to be a better way. How would you simplify the following code?
<% my_string = "something" %>
<% my_string = simple_format my_string %>
Of course, my_string ends up with <p>something</p>
This removes the opening p tag.
<% my_string[0..2] = "" %>
This removes the closing p tag.
<% my_string.chop! %>
<% my_string.chop! %>
<% my_string.chop! %>
<% my_string.chop! %>
Note: I don’t want to remove ALL p tags, only the ones added by simple_format.
If you’ve already applied the p tags: