instance method
extract_values_from_collection
Ruby on Rails 7.1.6
Since v2.3.18 PrivateSignature
extract_values_from_collection(collection, value_method, selected)
No documentation comment.
Parameters
-
collectionreq -
value_methodreq -
selectedreq
Source
# File actionview/lib/action_view/helpers/form_options_helper.rb, line 820
def extract_values_from_collection(collection, value_method, selected)
if selected.is_a?(Proc)
collection.filter_map do |element|
element.public_send(value_method) if selected.call(element)
end
else
selected
end
end
Defined in actionview/lib/action_view/helpers/form_options_helper.rb line 820
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::FormOptionsHelper