Rails remove parent HTML tag
- by gshankar
It's pretty easy to sanitize HTML and strip ALL instances of a HTML tag using Rails helpers...
But how do you just remove ONE tag? In this case, I'm using a WYSIWYG editor that insists on wrapping all my text in a <p> tag. I want to remove this parent tag without stripping out any other <p> tags within the content of the text.
I know I could do this in JQuery really easily but I feel like this should be done server-side in my controller before I save the text.
Is there a way to do this?