Module: PictureTag::ViewHelpers
- Defined in:
- lib/picture_tag/view_helpers.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
5 6 7 8 9 |
# File 'lib/picture_tag/view_helpers.rb', line 5 def self.included(klass) klass.class_eval do include ActionView::Context end end |
Instance Method Details
#picture_tag(srcset, options = {}, &block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/picture_tag/view_helpers.rb', line 11 def picture_tag(srcset, = {}, &block) = .except(:image) = .fetch(:image, {}) [:srcset] = srcset content_tag :picture, do "<!--[if IE 9]><video style='display: none;'><![endif]-->".html_safe + capture(&block).html_safe + '<!--[if IE 9]></video><![endif]-->'.html_safe + tag('img', ) end end |
#source_tag(options = {}) ⇒ Object
24 25 26 |
# File 'lib/picture_tag/view_helpers.rb', line 24 def source_tag( = {}) tag :source, end |