Module: Optimacms::FormsHelper
- Defined in:
- app/helpers/optimacms/forms_helper.rb
Instance Method Summary collapse
- #horizontal_simple_form_for(resource, options = {}, &block) ⇒ Object
- #horizontal_simple_search_form_for(filter_object, options = {}, &block) ⇒ Object
- #inline_simple_search_form_for(filter_object, options = {}, &block) ⇒ Object
Instance Method Details
#horizontal_simple_form_for(resource, options = {}, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/helpers/optimacms/forms_helper.rb', line 3 def horizontal_simple_form_for(resource, = {}, &block) [:html] ||= {} # class [:html][:class] ||= [] if [:html][:class].is_a? Array [:html][:class] << 'form-horizontal' else [:html][:class] << ' form-horizontal' end [:html][:role] = 'form' [:wrapper] = :horizontal_form [:wrapper_mappings] = {check_boxes: :horizontal_radio_and_checkboxes, radio_buttons: :horizontal_radio_and_checkboxes, file: :horizontal_file_input,boolean: :horizontal_boolean } simple_form_for(resource, , &block) end |
#horizontal_simple_search_form_for(filter_object, options = {}, &block) ⇒ Object
56 57 58 |
# File 'app/helpers/optimacms/forms_helper.rb', line 56 def horizontal_simple_search_form_for(filter_object, = {}, &block) return render 'tableview/filter.html.haml', style: :horizontal, filter_object: filter_object end |
#inline_simple_search_form_for(filter_object, options = {}, &block) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'app/helpers/optimacms/forms_helper.rb', line 23 def inline_simple_search_form_for(filter_object, = {}, &block) return render 'tableview/filter.html.haml', style: :inline, filter_object: filter_object return [:html] ||= {} [:url] = send(filter_object.url) [:html][:role] = 'form' # class [:html][:class] ||= [] if [:html][:class].is_a? String [:html][:class] = [[:html][:class]] end [:html][:class] << 'form-inline' [:html][:id] = 'formFilter' [:wrapper] = :inline_search_form [:wrapper_mappings] = { } capture do simple_form_for(:filter, ) do |f| concat(hidden_field_tag 'cmd', 'apply') concat(render 'tableview/filter_fields', filter: filter_object, f: f) concat(render 'tableview/buttons_apply_clear_inline', filter: filter_object, f: f) end end end |