7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/helpers/eac_rails_utils/common_form_helper/form_builder/association_select_field.rb', line 7
def association_select_field(field_name, options = {})
options = options.dup
methods = (options)
select_options = (options)
collection = (field_name, options, :collection, :all)
foreign_key = (field_name, options, :foreign_key,
:association_foreign_key)
field(field_name, options) do
form.collection_select(foreign_key, collection, methods[:value], methods[:text],
select_options, class: 'form-control')
end
end
|