Module: SimpleFormExtension::ResourceNameHelper

Included in:
Inputs::SelectizeInput
Defined in:
lib/simple_form_extension/resource_name_helper.rb

Instance Method Summary collapse

Instance Method Details

#resource_name_for(resource) ⇒ Object



3
4
5
6
7
# File 'lib/simple_form_extension/resource_name_helper.rb', line 3

def resource_name_for(resource)
  SimpleFormExtension.resource_name_methods.each do |method_name|
    if (value = resource.try(method_name)) then return value end
  end
end