Class: ExpressTemplates::Components::Forms::ExpressForm

Inherits:
Container
  • Object
show all
Includes:
Capabilities::Resourceful
Defined in:
lib/express_templates/components/forms/express_form.rb

Constant Summary

Constants inherited from Base

Base::MAP

Instance Method Summary collapse

Methods included from Capabilities::Resourceful

included, #namespace, #path_prefix, #resource_class

Methods inherited from Container

#appended, appends, #call_block, #prepended, prepends

Methods included from Capabilities::Hideable

included

Methods included from Capabilities::Configurable

included

Methods inherited from Base

abstract_component, abstract_component?, before_build, #build, builder_method, builder_method_and_class, contains, descendants, has_attributes, inherited, #initialize, require_parent, required_parent, tag

Constructor Details

This class inherits a constructor from ExpressTemplates::Components::Base

Instance Method Details

#form_actionObject



37
38
39
# File 'lib/express_templates/components/forms/express_form.rb', line 37

def form_action
  config[:action] || (resource.try(:persisted?) ? resource_path(resource) : collection_path)
end

#form_enctypeObject



41
42
43
# File 'lib/express_templates/components/forms/express_form.rb', line 41

def form_enctype
  config[:enctype]
end

#form_idObject



33
34
35
# File 'lib/express_templates/components/forms/express_form.rb', line 33

def form_id
  [config[:id], resource.try(:id)].compact.join('_')
end