In your htmlizeBody
function:
include Rails.application.routes.url_helpers
include ActionView::Helpers
This is in the wrong scope, moving it underneath extend ActiveSupport::Concern
will resolve your error.
Another question you could ask yourself is why you need to use view helpers at the concern level?
include Rails.application.routes.url_helpers
is usually used when modifying the default url host options (typically when you need to interface with an external API). In this case, it would make sense to use it in the /lib
directory.
See this SO post and this post on using url helpers for more info