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