Class: ApplicationForm
- Inherits:
-
Superform::Rails::Form
- Object
- Superform::Rails::Form
- ApplicationForm
- Includes:
- Phlex::Rails::Helpers::Pluralize
- Defined in:
- lib/generators/superform/install/templates/application_form.rb
Instance Method Summary collapse
Instance Method Details
#around_template ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/generators/superform/install/templates/application_form.rb', line 11 def around_template(&) super do yield submit end end |
#error_messages ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/generators/superform/install/templates/application_form.rb', line 19 def if model.errors.any? div(style: "color: red;") do h2 { "#{pluralize model.errors.count, "error"} prohibited this post from being saved:" } ul do model.errors.each do |error| li { error. } end end end end end |
#row(component) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/generators/superform/install/templates/application_form.rb', line 4 def row(component) div do render component.field.label(style: "display: block;") render component end end |