Module: LookupBy::Hooks::Formtastic
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/lookup_by/hooks/formtastic.rb
Instance Method Summary collapse
Instance Method Details
#input_with_lookup(method, options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/lookup_by/hooks/formtastic.rb', line 12 def input_with_lookup(method, = {}) klass = object.class if klass.respond_to?(:lookups) && klass.lookups.include?(method.to_sym) target = method.to_s.classify.constantize [:collection] ||= target.pluck(target.lookup.field) if target.lookup.cache_all? end input_without_lookup(method, ) end |