Skip to content

Commit 18810b0

Browse files
committed
Fix check_box and radio_button helper methods
These methods have difference signature.
1 parent d90cdf7 commit 18810b0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/vue-form-for/form_builder.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ module VueFormFor
44
class FormBuilder < ActionView::Helpers::FormBuilder
55
include VueFormFor::VueOptionsResolver
66

7-
(field_helpers - [:label, :fields_for]).each do |selector|
7+
(field_helpers - [:label, :check_box, :radio_button, :fields_for])
8+
.each do |selector|
89
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
910
def #{selector}(method, options = {})
1011
resolve_vue_options(options)
@@ -19,6 +20,16 @@ def label(method, text = nil, options = {}, &block)
1920
super(method, text, options, &block)
2021
end
2122

23+
def check_box(method, options = {}, checked_value = "1", unchecked_value = "0")
24+
resolve_vue_options(options)
25+
super(method, options, checked_value, unchecked_value)
26+
end
27+
28+
def radio_button(method, tag_value, options = {})
29+
resolve_vue_options(options)
30+
super(method, tag_value, options)
31+
end
32+
2233
def submit(value = nil, options = {})
2334
resolve_vue_options(options)
2435
super(value, options)

0 commit comments

Comments
 (0)