Module: BootboxCrud::ActionView::Helpers

Defined in:
lib/bootbox_crud/action_view/helpers.rb

Instance Method Summary collapse

Instance Method Details

#bb_alertObject



16
17
18
# File 'lib/bootbox_crud/action_view/helpers.rb', line 16

def bb_alert
  render :partial => 'layouts/bb_alert'
end

#form_optionsObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/bootbox_crud/action_view/helpers.rb', line 20

def form_options
  { html: { class: 'form-horizontal' }, 
    wrapper: :horizontal_form, 
    wrapper_mappings: {
    	check_boxes: :horizontal_radio_and_checkboxes, 
    	radio_buttons: :horizontal_radio_and_checkboxes, 
    	file: :horizontal_file_input, 
    	boolean: :horizontal_boolean
    }
  }
end

#remote_form_optionsObject



32
33
34
# File 'lib/bootbox_crud/action_view/helpers.rb', line 32

def remote_form_options
  { remote: true, authenticity_token: true }.merge(form_options)
end


8
9
10
# File 'lib/bootbox_crud/action_view/helpers.rb', line 8

def show_link_to(label, object, link_text)
  render :partial => 'layouts/show_link_to', :locals => { :label => label, :link_to_text => link_text, :link_to_object => object }
end


12
13
14
# File 'lib/bootbox_crud/action_view/helpers.rb', line 12

def show_link_to_array(label, objects, name_object_field)
  render :partial => 'layouts/show_link_to_array', :locals => { :label => label, :objects => objects, :field => name_object_field }
end

#show_value(label, value) ⇒ Object



4
5
6
# File 'lib/bootbox_crud/action_view/helpers.rb', line 4

def show_value(label, value)
  render :partial => 'layouts/show_value', :locals => { :label => label, :value => value }
end