Method: CustomTable::ApplicationHelper#custom_table_form_for
- Defined in:
- app/helpers/custom_table/application_helper.rb
#custom_table_form_for(record, options = {}, &block) ⇒ Object
MOVE TO GENERATED HELPER def boolean_icon(value, true_value = nil, false_value = nil)
capture do
concat content_tag(:i, "", class: (value ? "bi bi-check-lg text-success" : "bi bi-x-lg text-danger"), data: {raw: value})
concat content_tag(:span, value ? true_value : false_value, class: "ms-1") unless true_value.nil?
end
end
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/helpers/custom_table/application_helper.rb', line 12 def custom_table_form_for(record, = {}, &block) [:url] = request.path if [:url].nil? [:method] = :get [:html] ||= {} [:html][:class] = "row row-cols-sm-auto g-3 align-items-center custom-table-filter" [:wrapper] = [:wrapper] || :ct_inline_form [:wrapper_mappings] = { boolean: :ct_inline_boolean, check_boxes: :ct_vertical_collection, radio_buttons: :ct_vertical_collection, date: :ct_inline_element, select: :ct_inline_select } simple_form_for(record, , &block) end |