test/dummy/app/helpers/application_helper.rb in upgrow-0.0.3 vs test/dummy/app/helpers/application_helper.rb in upgrow-0.0.4
- old
+ new
@@ -1,6 +1,7 @@
# frozen_string_literal: true
+
module ApplicationHelper
class BulmaFormBuilder < ActionView::Helpers::FormBuilder
# Generic field wrapper for form inputs.
#
# It wraps the given block in a field div. In case a method is specified it
@@ -109,15 +110,13 @@
end
end
private
- def control(expanded: false)
+ def control(expanded: false, &block)
control_class = ['control']
control_class << ['is-expanded'] if expanded
- @template.content_tag(:p, class: control_class) do
- yield
- end
+ @template.content_tag(:p, class: control_class, &block)
end
def errors_for(method)
(options[:errors] || []).select { |error| error.attribute == method }
end