Class: KonoUtils::Object::Cell::Form

Inherits:
Base
  • Object
show all
Includes:
ActionView::Helpers::DateHelper, ActionView::Helpers::FormHelper, ActionView::Helpers::FormOptionsHelper, SimpleForm::ActionViewExtensions::FormHelper
Defined in:
app/concepts/kono_utils/object/cell/form.rb

Direct Known Subclasses

Searches::Form

Instance Method Summary collapse

Methods inherited from Base

#_prefixes, #base_class, #concept, #content_for_layout, #content_for_layout?, #destroy_custom_polymorphic_path, #edit_custom_polymorphic_path, #index_custom_polymorphic_path, #kono_user, #legacy_concept, logger, #model_gender, #new_custom_polymorphic_path, #show_custom_polymorphic_path, #title_del, #title_del_g, #title_edit_g, #title_mod, #title_new, #title_new_g, #title_newa, #title_show_g

Methods included from KonoUtilsBootstrapView4::ApplicationIconHelper

#fa_icon, #icon

Instance Method Details

#forms_optionsArray

Metodo che mi ritorna la lista degli argomenti da passare a simple form. ES:

model

-> model deve essere l’ActiveRecord da utilizzare come oggetto della form

model,{ url:helper_path_custom }

-> come secondo parametro abbiamo l’hash delle opzioni da poter passare al form builder

se al concept passiamo form_options come opzione, queste vengono mergiate nelle opzioni standard

Returns:

  • (Array)


23
24
25
# File 'app/concepts/kono_utils/object/cell/form.rb', line 23

def forms_options
  [model, _form_options]
end

#submit_buttons(form_builder:) ⇒ Object

Elenco di concept di bottoni da generare nella form per il submit

Parameters:

  • form_builder (SimpleForm::FormBuilder)


30
31
32
# File 'app/concepts/kono_utils/object/cell/form.rb', line 30

def submit_buttons(form_builder:)
  [concept("cell/forms/submit", nil, context: {form: form_builder})]
end