class ActionText::Fragment
def replace(selector)
def replace(selector) update do |source| source.css(selector).each do |node| replacement_node = yield(node) node.replace(replacement_node.to_s) if node != replacement_node end end end
def replace(selector) update do |source| source.css(selector).each do |node| replacement_node = yield(node) node.replace(replacement_node.to_s) if node != replacement_node end end end