From b7b660ffc5b67152233b999c9fb90b383e5c3866 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sun, 16 Jun 2013 20:25:12 +0200 Subject: [PATCH] Modify StopTime#Mab#mab_done to transform underscores to dashes in classes --- stoptime.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stoptime.rb b/stoptime.rb index eef0707..f38194d 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -88,6 +88,12 @@ module StopTime::Mab SUPPORTED = [:get, :post] def mab_done(tag) + # Transform underscores into dashs in class names + if tag._attributes.has_key?(:class) and tag._attributes[:class].present? + tag._attributes[:class] = tag._attributes[:class].gsub('_', '-') + end + + # The followin method processing is only for form tags. return super unless tag._name == :form meth = tag._attributes[:method]