Module: ViewComponent::Form::Helpers::Rails8
- Included in:
- Builder
- Defined in:
- lib/view_component/form/helpers/rails8.rb
Overview
Rails 8.0 changed the spelling of a couple form builder methods while adding aliases for backward compatibility. This module adds those new methods.
github.com/rails/rails/blob/8-0-stable/actionview/CHANGELOG.md#rails-800beta1-september-26-2024
Instance Method Summary collapse
- #checkbox(method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object
-
#collection_checkboxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block) ⇒ Object
rubocop:disable Metrics/ParameterLists.
- #rich_textarea(method, options = {}) ⇒ Object
- #textarea(method, options = {}) ⇒ Object
Instance Method Details
#checkbox(method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object
15 16 17 |
# File 'lib/view_component/form/helpers/rails8.rb', line 15 def checkbox(method, = {}, checked_value = "1", unchecked_value = "0") render_component(:check_box, @object_name, method, checked_value, unchecked_value, ()) end |
#collection_checkboxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block) ⇒ Object
rubocop:disable Metrics/ParameterLists
19 20 21 22 23 24 25 |
# File 'lib/view_component/form/helpers/rails8.rb', line 19 def collection_checkboxes(method, collection, value_method, text_method, = {}, = {}, # rubocop:disable Metrics/ParameterLists &block) render_component( :collection_check_boxes, @object_name, method, collection, value_method, text_method, (), @default_html_options.merge(), &block ) end |
#rich_textarea(method, options = {}) ⇒ Object
28 29 30 |
# File 'lib/view_component/form/helpers/rails8.rb', line 28 def rich_textarea(method, = {}) render_component(:rich_text_area, @object_name, method, ()) end |
#textarea(method, options = {}) ⇒ Object
11 12 13 |
# File 'lib/view_component/form/helpers/rails8.rb', line 11 def textarea(method, = {}) render_component(:text_area, @object_name, method, ()) end |