lib/express_templates/components/forms/submit.rb in express_templates-0.5.0 vs lib/express_templates/components/forms/submit.rb in express_templates-0.7.0
- old
+ new
@@ -1,26 +1,27 @@
module ExpressTemplates
module Components
module Forms
class Submit < FormComponent
- emits -> {
+ def build(*args)
div(class: field_wrapper_class) {
- submit_tag(value, html_options)
+ if args.first.is_a?(String) or args.empty?
+ submit_tag(args.first || 'Save', (args[1]||{}))
+ else
+ submit_tag 'Save', (args[1] || {})
+ end
}
- }
+ end
def value
if @args.first.is_a?(String)
@args.first
else
'Save'
end
end
- def html_options
- @config
- end
end
end
end
end