Module: Formtastic::Helpers::Reflection

Included in:
ErrorsHelper, InputHelper
Defined in:
lib/formtastic/helpers/reflection.rb

Instance Method Summary collapse

Instance Method Details

#reflection_for(method) ⇒ Object

If an association method is passed in (f.input :author) try to find the reflection object.



7
8
9
# File 'lib/formtastic/helpers/reflection.rb', line 7

def reflection_for(method) #:nodoc:
  @object.class.reflect_on_association(method) if @object.class.respond_to?(:reflect_on_association)
end