@@ -53,7 +53,7 @@ module Builder
53
53
# label: -> { tag.h3('Call-sign') }
54
54
#
55
55
def govuk_text_field ( attribute_name , hint : { } , label : { } , caption : { } , width : nil , extra_letter_spacing : false , form_group : { } , prefix_text : nil , suffix_text : nil , **kwargs , &block )
56
- Elements ::Inputs ::Text . new ( self , object_name , attribute_name , hint : hint , label : label , caption : caption , width : width , extra_letter_spacing : extra_letter_spacing , form_group : form_group , prefix_text : prefix_text , suffix_text : suffix_text , **kwargs , &block ) . html
56
+ Elements ::Inputs ::Text . new ( self , object_name , attribute_name , hint :, label :, caption :, width :, extra_letter_spacing :, form_group :, prefix_text :, suffix_text :, **kwargs , &block ) . html
57
57
end
58
58
59
59
# Generates a input of type +tel+
@@ -107,7 +107,7 @@ def govuk_text_field(attribute_name, hint: {}, label: {}, caption: {}, width: ni
107
107
# label: -> { tag.h3('Work number') }
108
108
#
109
109
def govuk_phone_field ( attribute_name , hint : { } , label : { } , caption : { } , width : nil , extra_letter_spacing : false , form_group : { } , prefix_text : nil , suffix_text : nil , **kwargs , &block )
110
- Elements ::Inputs ::Phone . new ( self , object_name , attribute_name , hint : hint , label : label , caption : caption , width : width , extra_letter_spacing : extra_letter_spacing , form_group : form_group , prefix_text : prefix_text , suffix_text : suffix_text , **kwargs , &block ) . html
110
+ Elements ::Inputs ::Phone . new ( self , object_name , attribute_name , hint :, label :, caption :, width :, extra_letter_spacing :, form_group :, prefix_text :, suffix_text :, **kwargs , &block ) . html
111
111
end
112
112
113
113
# Generates a input of type +email+
@@ -159,7 +159,7 @@ def govuk_phone_field(attribute_name, hint: {}, label: {}, caption: {}, width: n
159
159
# label: -> { tag.h3('Personal email address') }
160
160
#
161
161
def govuk_email_field ( attribute_name , hint : { } , label : { } , caption : { } , width : nil , extra_letter_spacing : false , form_group : { } , prefix_text : nil , suffix_text : nil , **kwargs , &block )
162
- Elements ::Inputs ::Email . new ( self , object_name , attribute_name , hint : hint , label : label , caption : caption , width : width , extra_letter_spacing : extra_letter_spacing , form_group : form_group , prefix_text : prefix_text , suffix_text : suffix_text , **kwargs , &block ) . html
162
+ Elements ::Inputs ::Email . new ( self , object_name , attribute_name , hint :, label :, caption :, width :, extra_letter_spacing :, form_group :, prefix_text :, suffix_text :, **kwargs , &block ) . html
163
163
end
164
164
165
165
# Generates a input of type +password+
@@ -210,7 +210,7 @@ def govuk_email_field(attribute_name, hint: {}, label: {}, caption: {}, width: n
210
210
# label: -> { tag.h3('What is your secret pass code?') }
211
211
#
212
212
def govuk_password_field ( attribute_name , hint : { } , label : { } , width : nil , extra_letter_spacing : false , form_group : { } , caption : { } , prefix_text : nil , suffix_text : nil , **kwargs , &block )
213
- Elements ::Inputs ::Password . new ( self , object_name , attribute_name , hint : hint , label : label , caption : caption , width : width , extra_letter_spacing : extra_letter_spacing , form_group : form_group , prefix_text : prefix_text , suffix_text : suffix_text , **kwargs , &block ) . html
213
+ Elements ::Inputs ::Password . new ( self , object_name , attribute_name , hint :, label :, caption :, width :, extra_letter_spacing :, form_group :, prefix_text :, suffix_text :, **kwargs , &block ) . html
214
214
end
215
215
216
216
# Generates a input of type +url+
@@ -262,7 +262,7 @@ def govuk_password_field(attribute_name, hint: {}, label: {}, width: nil, extra_
262
262
# label: -> { tag.h3("Enter your company's website") }
263
263
#
264
264
def govuk_url_field ( attribute_name , hint : { } , label : { } , caption : { } , width : nil , extra_letter_spacing : false , form_group : { } , prefix_text : nil , suffix_text : nil , **kwargs , &block )
265
- Elements ::Inputs ::URL . new ( self , object_name , attribute_name , hint : hint , label : label , caption : caption , width : width , extra_letter_spacing : extra_letter_spacing , form_group : form_group , prefix_text : prefix_text , suffix_text : suffix_text , **kwargs , &block ) . html
265
+ Elements ::Inputs ::URL . new ( self , object_name , attribute_name , hint :, label :, caption :, width :, extra_letter_spacing :, form_group :, prefix_text :, suffix_text :, **kwargs , &block ) . html
266
266
end
267
267
268
268
# Generates a input of type +number+
@@ -317,7 +317,7 @@ def govuk_url_field(attribute_name, hint: {}, label: {}, caption: {}, width: nil
317
317
# label: -> { tag.h3("How many seconds does it take you to run 100m?") }
318
318
#
319
319
def govuk_number_field ( attribute_name , hint : { } , label : { } , caption : { } , width : nil , extra_letter_spacing : false , form_group : { } , prefix_text : nil , suffix_text : nil , **kwargs , &block )
320
- Elements ::Inputs ::Number . new ( self , object_name , attribute_name , hint : hint , label : label , caption : caption , width : width , extra_letter_spacing : extra_letter_spacing , form_group : form_group , prefix_text : prefix_text , suffix_text : suffix_text , **kwargs , &block ) . html
320
+ Elements ::Inputs ::Number . new ( self , object_name , attribute_name , hint :, label :, caption :, width :, extra_letter_spacing :, form_group :, prefix_text :, suffix_text :, **kwargs , &block ) . html
321
321
end
322
322
323
323
# Generates a +textarea+ element with a label, optional hint. Also offers
@@ -373,7 +373,7 @@ def govuk_number_field(attribute_name, hint: {}, label: {}, caption: {}, width:
373
373
# label: -> { tag.h3("How do you set it up?") }
374
374
#
375
375
def govuk_text_area ( attribute_name , hint : { } , label : { } , caption : { } , max_words : nil , max_chars : nil , rows : 5 , threshold : nil , form_group : { } , **kwargs , &block )
376
- Elements ::TextArea . new ( self , object_name , attribute_name , hint : hint , label : label , caption : caption , max_words : max_words , max_chars : max_chars , rows : rows , threshold : threshold , form_group : form_group , **kwargs , &block ) . html
376
+ Elements ::TextArea . new ( self , object_name , attribute_name , hint :, label :, caption :, max_words :, max_chars :, rows :, threshold :, form_group :, **kwargs , &block ) . html
377
377
end
378
378
379
379
# Generates a +select+ element containing +option+ for each member in the provided collection
@@ -422,13 +422,13 @@ def govuk_collection_select(attribute_name, collection, value_method, text_metho
422
422
object_name ,
423
423
attribute_name ,
424
424
collection ,
425
- value_method : value_method ,
426
- text_method : text_method ,
427
- hint : hint ,
428
- label : label ,
429
- caption : caption ,
430
- options : options ,
431
- form_group : form_group ,
425
+ value_method :,
426
+ text_method :,
427
+ hint :,
428
+ label :,
429
+ caption :,
430
+ options :,
431
+ form_group :,
432
432
**kwargs ,
433
433
&block
434
434
) . html
@@ -466,7 +466,7 @@ def govuk_collection_select(attribute_name, collection, value_method, text_metho
466
466
# = f.govuk_select :hat_colour, options_for_select(@colours)
467
467
#
468
468
def govuk_select ( attribute_name , choices = nil , options : { } , label : { } , hint : { } , form_group : { } , caption : { } , **kwargs , &block )
469
- Elements ::Select . new ( self , object_name , attribute_name , choices , options : options , label : label , hint : hint , form_group : form_group , caption : caption , **kwargs , &block ) . html
469
+ Elements ::Select . new ( self , object_name , attribute_name , choices , options :, label :, hint :, form_group :, caption :, **kwargs , &block ) . html
470
470
end
471
471
472
472
# Generates a radio button for each item in the supplied collection
@@ -546,17 +546,17 @@ def govuk_collection_radio_buttons(attribute_name, collection, value_method, tex
546
546
object_name ,
547
547
attribute_name ,
548
548
collection ,
549
- value_method : value_method ,
550
- text_method : text_method ,
551
- hint_method : hint_method ,
552
- hint : hint ,
553
- legend : legend ,
554
- caption : caption ,
555
- inline : inline ,
556
- small : small ,
557
- bold_labels : bold_labels ,
558
- form_group : form_group ,
559
- include_hidden : include_hidden ,
549
+ value_method :,
550
+ text_method :,
551
+ hint_method :,
552
+ hint :,
553
+ legend :,
554
+ caption :,
555
+ inline :,
556
+ small :,
557
+ bold_labels :,
558
+ form_group :,
559
+ include_hidden :,
560
560
**kwargs ,
561
561
&block
562
562
) . html
@@ -611,7 +611,7 @@ def govuk_collection_radio_buttons(attribute_name, collection, value_method, tex
611
611
# = f.govuk_radio_button :burger_id, :cheese, label: { text: 'Cheeseburger' }
612
612
#
613
613
def govuk_radio_buttons_fieldset ( attribute_name , hint : { } , legend : { } , caption : { } , inline : false , small : false , form_group : { } , **kwargs , &block )
614
- Containers ::RadioButtonsFieldset . new ( self , object_name , attribute_name , hint : hint , legend : legend , caption : caption , inline : inline , small : small , form_group : form_group , **kwargs , &block ) . html
614
+ Containers ::RadioButtonsFieldset . new ( self , object_name , attribute_name , hint :, legend :, caption :, inline :, small :, form_group :, **kwargs , &block ) . html
615
615
end
616
616
617
617
# Generates a radio button
@@ -643,7 +643,7 @@ def govuk_radio_buttons_fieldset(attribute_name, hint: {}, legend: {}, caption:
643
643
# = f.govuk_radio_button :favourite_colour, :red, label: { text: 'Red' }
644
644
#
645
645
def govuk_radio_button ( attribute_name , value , hint : { } , label : { } , link_errors : false , **kwargs , &block )
646
- Elements ::Radios ::FieldsetRadioButton . new ( self , object_name , attribute_name , value , hint : hint , label : label , link_errors : link_errors , **kwargs , &block ) . html
646
+ Elements ::Radios ::FieldsetRadioButton . new ( self , object_name , attribute_name , value , hint :, label :, link_errors :, **kwargs , &block ) . html
647
647
end
648
648
649
649
# Inserts a text divider into a list of radio buttons
@@ -725,15 +725,15 @@ def govuk_collection_check_boxes(attribute_name, collection, value_method, text_
725
725
object_name ,
726
726
attribute_name ,
727
727
collection ,
728
- value_method : value_method ,
729
- text_method : text_method ,
730
- hint_method : hint_method ,
731
- hint : hint ,
732
- legend : legend ,
733
- caption : caption ,
734
- small : small ,
735
- form_group : form_group ,
736
- include_hidden : include_hidden ,
728
+ value_method :,
729
+ text_method :,
730
+ hint_method :,
731
+ hint :,
732
+ legend :,
733
+ caption :,
734
+ small :,
735
+ form_group :,
736
+ include_hidden :,
737
737
**kwargs ,
738
738
&block
739
739
) . html
@@ -782,12 +782,12 @@ def govuk_check_boxes_fieldset(attribute_name, legend: {}, caption: {}, hint: {}
782
782
self ,
783
783
object_name ,
784
784
attribute_name ,
785
- hint : hint ,
786
- legend : legend ,
787
- caption : caption ,
788
- small : small ,
789
- form_group : form_group ,
790
- multiple : multiple ,
785
+ hint :,
786
+ legend :,
787
+ caption :,
788
+ small :,
789
+ form_group :,
790
+ multiple :,
791
791
**kwargs ,
792
792
&block
793
793
) . html
@@ -830,11 +830,11 @@ def govuk_check_box(attribute_name, value, unchecked_value = false, hint: {}, la
830
830
attribute_name ,
831
831
value ,
832
832
unchecked_value ,
833
- hint : hint ,
834
- label : label ,
835
- link_errors : link_errors ,
836
- multiple : multiple ,
837
- exclusive : exclusive ,
833
+ hint :,
834
+ label :,
835
+ link_errors :,
836
+ multiple :,
837
+ exclusive :,
838
838
**kwargs ,
839
839
&block
840
840
) . html
@@ -883,7 +883,7 @@ def govuk_check_box_divider(text = config.default_check_box_divider_text)
883
883
# = link_to 'Cancel', some_other_path, class: 'govuk-button__secondary'
884
884
#
885
885
def govuk_submit ( text = config . default_submit_button_text , warning : false , secondary : false , inverse : false , prevent_double_click : true , validate : config . default_submit_validate , disabled : false , **kwargs , &block )
886
- Elements ::Submit . new ( self , text , warning : warning , secondary : secondary , inverse : inverse , prevent_double_click : prevent_double_click , validate : validate , disabled : disabled , **kwargs , &block ) . html
886
+ Elements ::Submit . new ( self , text , warning :, secondary :, inverse :, prevent_double_click :, validate :, disabled :, **kwargs , &block ) . html
887
887
end
888
888
889
889
# Generates three inputs for the +day+, +month+ and +year+ components of a date
@@ -932,7 +932,7 @@ def govuk_submit(text = config.default_submit_button_text, warning: false, secon
932
932
# = f.govuk_date_field :finishes_on,
933
933
# legend: -> { tag.h3('Which category do you belong to?') }
934
934
def govuk_date_field ( attribute_name , hint : { } , legend : { } , caption : { } , date_of_birth : false , omit_day : false , maxlength_enabled : false , form_group : { } , **kwargs , &block )
935
- Elements ::Date . new ( self , object_name , attribute_name , hint : hint , legend : legend , caption : caption , date_of_birth : date_of_birth , omit_day : omit_day , maxlength_enabled : maxlength_enabled , form_group : form_group , **kwargs , &block ) . html
935
+ Elements ::Date . new ( self , object_name , attribute_name , hint :, legend :, caption :, date_of_birth :, omit_day :, maxlength_enabled :, form_group :, **kwargs , &block ) . html
936
936
end
937
937
938
938
# Generates a summary of errors in the form, each linking to the corresponding
@@ -962,7 +962,7 @@ def govuk_date_field(attribute_name, hint: {}, legend: {}, caption: {}, date_of_
962
962
#
963
963
# @see https://design-system.service.gov.uk/components/error-summary/ GOV.UK error summary
964
964
def govuk_error_summary ( title = config . default_error_summary_title , presenter : config . default_error_summary_presenter , link_base_errors_to : nil , order : nil , **kwargs , &block )
965
- Elements ::ErrorSummary . new ( self , object_name , title , link_base_errors_to : link_base_errors_to , order : order , presenter : presenter , **kwargs , &block ) . html
965
+ Elements ::ErrorSummary . new ( self , object_name , title , link_base_errors_to :, order :, presenter :, **kwargs , &block ) . html
966
966
end
967
967
968
968
# Generates a fieldset containing the contents of the block
@@ -995,7 +995,7 @@ def govuk_error_summary(title = config.default_error_summary_title, presenter: c
995
995
# @see https://design-system.service.gov.uk/styles/typography/#headings-with-captions Headings with captions
996
996
# @return [ActiveSupport::SafeBuffer] HTML output
997
997
def govuk_fieldset ( legend : { text : 'Fieldset heading' } , caption : { } , described_by : nil , **kwargs , &block )
998
- Containers ::Fieldset . new ( self , legend : legend , caption : caption , described_by : described_by , **kwargs , &block ) . html
998
+ Containers ::Fieldset . new ( self , legend :, caption :, described_by :, **kwargs , &block ) . html
999
999
end
1000
1000
1001
1001
# Generates an input of type +file+
@@ -1036,7 +1036,7 @@ def govuk_fieldset(legend: { text: 'Fieldset heading' }, caption: {}, described_
1036
1036
# uploads, {https://guides.rubyonrails.org/form_helpers.html#uploading-files see
1037
1037
# the Rails documentation} for more information
1038
1038
def govuk_file_field ( attribute_name , label : { } , caption : { } , hint : { } , form_group : { } , **kwargs , &block )
1039
- Elements ::File . new ( self , object_name , attribute_name , label : label , caption : caption , hint : hint , form_group : form_group , **kwargs , &block ) . html
1039
+ Elements ::File . new ( self , object_name , attribute_name , label :, caption :, hint :, form_group :, **kwargs , &block ) . html
1040
1040
end
1041
1041
end
1042
1042
end
0 commit comments