Module: BootstrapHelper

Extended by:
ActiveSupport::Concern
Included in:
BootstrapBaseHelper, BootstrapButtonHelper, BootstrapComponentHelper, BootstrapNotifyHelper, BootstrapPostPaginateHelper, BootstrapTabHelper, BootstrapTableHelper
Defined in:
app/helpers/bootstrap_helper.rb

Instance Method Summary collapse

Instance Method Details

#div(opts = {}, &block) ⇒ Object



10
11
12
13
14
# File 'app/helpers/bootstrap_helper.rb', line 10

def div(opts={}, &block)
  ('div', nil, opts) do
    capture(&block) if block_given?
  end
end

#javascript_include_tag_with_p(path) ⇒ Object

可以传参数的javascript_include_tag



6
7
8
# File 'app/helpers/bootstrap_helper.rb', line 6

def javascript_include_tag_with_p(path)
  javascript_tag nil, :src => path
end

#merge_predef_class(class_str, options = {}) ⇒ Object

合并预定义class



19
20
21
22
23
# File 'app/helpers/bootstrap_helper.rb', line 19

def merge_predef_class(class_str, options={})
  predef_class = [class_str]
  predef_class << (options.delete(:class) || options.delete(:ext_class) || '')
  options.merge!({class: predef_class.compact.join(' ')})
end