Module: TagMetadataExtension
- Defined in:
- lib/common-extensions/tag_metadata_extension.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 7 8 |
# File 'lib/common-extensions/tag_metadata_extension.rb', line 4 def self.included base base.class_eval do alias_method_chain :content_tag, :metadata end end |
.parse_metadata!(options) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/common-extensions/tag_metadata_extension.rb', line 20 def return if .nil? if ( = .delete(:metadata)) data = .delete(:data) .merge! :data => [ data, .to_json.gsub('"', "'") ].compact.join(' ') end end |
Instance Method Details
#content_tag_with_metadata(name, options_with_block = nil, options_without_block = nil, escape = true, &block) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/common-extensions/tag_metadata_extension.rb', line 10 def name, = nil, = nil, escape = true, &block if block.blank? TagMetadataExtension. else TagMetadataExtension. end name, , , escape, &block end |