Class: Para::Component::Form
Instance Method Summary
collapse
Methods included from History
#history?
Methods inherited from Resource
#model, #model_table_name
Methods inherited from Base
configurable_on, #exportable?, #history?, #main_navigation_name, model_name, #name, register, #subclassable?, #to_param
with_belongs_to_optional_option_if_needed
Instance Method Details
22
23
24
|
# File 'app/models/para/component/form.rb', line 22
def default_form_actions
[:submit]
end
|
#resource ⇒ Object
13
14
15
16
|
# File 'app/models/para/component/form.rb', line 13
def resource
build_component_resource(resource: model.new) unless component_resource
component_resource.resource ||= model.new
end
|
#resource=(value) ⇒ Object
18
19
20
|
# File 'app/models/para/component/form.rb', line 18
def resource=(value)
build_component_resource(resource: value) unless component_resource
end
|
#update_with(attributes) ⇒ Object
26
27
28
29
30
31
32
33
34
35
|
# File 'app/models/para/component/form.rb', line 26
def update_with(attributes)
attributes[:model_type] ||= identifier.to_s.camelize.singularize if identifier
attributes[:controller] ||= '/para/admin/form_resources'
super
end
|