Clean-up html tags in all posts after migration?

Oops. Sorry. That’s what the g in gsub does! I don’t know what I was thinking.

If you put the puts after the gsub do you see the replacement being done?

Also, what I world do is run the code by hand one line at a time and see if it does what you expect and see if changes made there are affecting the database you’re trying to affect.

1 Like

So… I think I know what has caused my confusion…

‘rails c’ vs ’ d/rails c’

My absolute inexperience in working with containers wreaking havoc here. My script working fine, removing the tags outside of the container but then when firing up the d/unicorn all the tags were still there. Now when doing d/rails c I do see all the tags I want to get rid of…

OMG. This must have been so obvious a thing to do that you @pfaffman didn’t think of this biting me LOL.

Anyways, I think I am all set to clean up my posts in an automated fashion on my live site too.


That’s a new one on me! I figured that you somehow were accessing two databases, but even now that you’ve explained it, I don’t quite know what was happening!

Glad you got it!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.