Module: SmartManaging::ApplicationHelper

Defined in:
app/helpers/smart_managing/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#colspanObject



6
7
8
# File 'app/helpers/smart_managing/application_helper.rb', line 6

def colspan
  number_of_attributes + 1
end

#field_for(form:, klass:, attr:) ⇒ Object



18
19
20
21
22
23
24
# File 'app/helpers/smart_managing/application_helper.rb', line 18

def field_for(form:, klass:, attr:)
  if klass.reflect_on_association(attr)
    form.send(:association, attr)
  else
    form.send(:input, attr)
  end
end

#new_item_pathObject



14
15
16
# File 'app/helpers/smart_managing/application_helper.rb', line 14

def new_item_path
  new_polymorphic_path(klass)
end