app/views/adminpanel/form/_select.html.erb in adminpanel-3.2.1 vs app/views/adminpanel/form/_select.html.erb in adminpanel-3.3.0
- old
+ new
@@ -7,14 +7,14 @@
properties['name_method'] ||= :name
collection = options_from_collection_for_select(
collection,
properties['id_method'],
properties['name_method'],
- @resource_instance.send(attribute)
+ @resource_instance.try(attribute)
)
elsif ['Hash', 'Array', 'HashWithIndifferentAccess'].include? collection.class.to_s.demodulize
- collection = options_for_select(collection)
+ collection = options_for_select(collection, @resource_instance.try(attribute))
end
%>
<%= f.select attribute, collection, { include_blank: true }, args %>
<% if !is_modal &&