Module: Bootstrap::ImageHelper

Included in:
BaseHelper
Defined in:
app/helpers/bootstrap/image_helper.rb

Instance Method Summary collapse

Instance Method Details

#c_image_tag(source, options = {}) ⇒ Object

Public: Circle image helper. Use it as the same as image_tag.



10
11
12
# File 'app/helpers/bootstrap/image_helper.rb', line 10

def c_image_tag(source, options = {})
  image_tag(source, merge_predef_class('img-circle', options))
end

#glyph_icon(*names) ⇒ Object

Public: Bootstrap icons helpers by Glyphicons.

names - icon names, passed in one by one.

Examples

glyph_icon(:plus)
# => <i class="icon-plus"></i>

glyph_icon(:align_justify, :white)
# => <i class="icon-align-justify icon-white"></i>

glyph_icon(%w(plus white))

Returns an i tag with icon classes.



34
35
36
# File 'app/helpers/bootstrap/image_helper.rb', line 34

def glyph_icon(*names)
   :i, nil, class: names.flatten.map { |name| "icon-#{name.to_s.gsub('_', '-')}" }
end

#p_image_tag(source, options = {}) ⇒ Object

public: Polaroid image helper. Use it as the same as image_tag.



15
16
17
# File 'app/helpers/bootstrap/image_helper.rb', line 15

def p_image_tag(source, options = {})
  image_tag(source, merge_predef_class('img-polaroid', options))
end

#r_image_tag(source, options = {}) ⇒ Object

Public: Rounded image helper. Use it as the same as image_tag.



5
6
7
# File 'app/helpers/bootstrap/image_helper.rb', line 5

def r_image_tag(source, options = {})
  image_tag(source, merge_predef_class('img-rounded', options))
end