Class: KonoUtils::ApplicationHelper::BaseSearchFormWrapper
- Inherits:
-
Struct
- Object
- Struct
- KonoUtils::ApplicationHelper::BaseSearchFormWrapper
- Defined in:
- lib/kono_utils/application_helper.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#current_user ⇒ Object
Returns the value of attribute current_user.
-
#formtastic_form ⇒ Object
Returns the value of attribute formtastic_form.
Instance Method Summary collapse
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes
99 100 101 |
# File 'lib/kono_utils/application_helper.rb', line 99 def attributes @attributes end |
#current_user ⇒ Object
Returns the value of attribute current_user
99 100 101 |
# File 'lib/kono_utils/application_helper.rb', line 99 def current_user @current_user end |
#formtastic_form ⇒ Object
Returns the value of attribute formtastic_form
99 100 101 |
# File 'lib/kono_utils/application_helper.rb', line 99 def formtastic_form @formtastic_form end |
Instance Method Details
#fields_builder(cfgs = {field_options: {}}) ⇒ Object
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/kono_utils/application_helper.rb', line 101 def fields_builder(cfgs={field_options: {}}) form_buffer = ActiveSupport::SafeBuffer.new self.attributes.each do |field| = field. if .is_a?(Proc) = .call(current_user, self.formtastic_form) end form_buffer << self.formtastic_form.input(field.field, cfgs[:field_options].merge()) end form_buffer end |