Skip to content

Commit 2eae907

Browse files
committed
Add anchor links to FormOptionsHelper [ci skip]
The documentation in lib/action_view/helpers/form_options_helper.rb has many references to methods in the same file. This commit improves the documentation so those references are anchor links. ![Image](https://github.com/user-attachments/assets/57b111a4-9c49-4540-81e1-192f6f009756)
1 parent 3eb5f34 commit 2eae907

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

actionview/lib/action_view/helpers/form_options_helper.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Helpers # :nodoc:
1313
#
1414
# Provides a number of methods for turning different kinds of containers into a set of option tags.
1515
#
16-
# The <tt>collection_select</tt>, <tt>select</tt> and <tt>time_zone_select</tt> methods take an <tt>options</tt> parameter, a hash:
16+
# The #collection_select, #select and #time_zone_select methods take an <tt>options</tt> parameter, a hash:
1717
#
1818
# * <tt>:include_blank</tt> - set to true or a prompt string if the first option element of the select element is a blank. Useful if there is not a default value required for the select element.
1919
#
@@ -55,7 +55,7 @@ module Helpers # :nodoc:
5555
# <option value="3">Rafael</option>
5656
# </select>
5757
#
58-
# * <tt>:index</tt> - like the other form helpers, <tt>select</tt> can accept an <tt>:index</tt> option to manually set the ID used in the resulting output. Unlike other helpers, <tt>select</tt> expects this
58+
# * <tt>:index</tt> - like the other form helpers, #select can accept an <tt>:index</tt> option to manually set the ID used in the resulting output. Unlike other helpers, #select expects this
5959
# option to be in the +html_options+ parameter.
6060
#
6161
# select("album[]", :genre, %w[ rap rock country ], {}, { index: nil })
@@ -80,7 +80,7 @@ module Helpers # :nodoc:
8080
# <option disabled="disabled" value="restricted">restricted</option>
8181
# </select>
8282
#
83-
# When used with the <tt>collection_select</tt> helper, <tt>:disabled</tt> can also be a Proc that identifies those options that should be disabled.
83+
# When used with the #collection_select helper, <tt>:disabled</tt> can also be a Proc that identifies those options that should be disabled.
8484
#
8585
# collection_select(:post, :category_id, Category.all, :id, :name, { disabled: -> (category) { category.archived? } })
8686
#
@@ -126,7 +126,7 @@ module FormOptionsHelper
126126
# or <tt>selected: nil</tt> to leave all options unselected. Similarly, you can specify values to be disabled in the option
127127
# tags by specifying the <tt>:disabled</tt> option. This can either be a single value or an array of values to be disabled.
128128
#
129-
# A block can be passed to +select+ to customize how the options tags will be rendered. This
129+
# A block can be passed to #select to customize how the options tags will be rendered. This
130130
# is useful when the options tag has complex attributes.
131131
#
132132
# select(report, :campaign_ids) do
@@ -265,7 +265,7 @@ def grouped_collection_select(object, method, collection, group_method, group_la
265265
# In addition to the <tt>:include_blank</tt> option documented above,
266266
# this method also supports a <tt>:model</tt> option, which defaults
267267
# to ActiveSupport::TimeZone. This may be used by users to specify a
268-
# different time zone model object. (See +time_zone_options_for_select+
268+
# different time zone model object. (See #time_zone_options_for_select
269269
# for more information.)
270270
#
271271
# You can also supply an array of ActiveSupport::TimeZone objects
@@ -294,7 +294,7 @@ def time_zone_select(object, method, priority_zones = nil, options = {}, html_op
294294
end
295295

296296
# Returns select and option tags for the given object and method, using
297-
# <tt>weekday_options_for_select</tt> to generate the list of option tags.
297+
# #weekday_options_for_select to generate the list of option tags.
298298
def weekday_select(object, method, options = {}, html_options = {}, &block)
299299
Tags::WeekdaySelect.new(object, method, self, options, html_options, &block).render
300300
end
@@ -411,7 +411,7 @@ def options_from_collection_for_select(collection, value_method, text_method, se
411411
options_for_select(options, select_deselect)
412412
end
413413

414-
# Returns a string of <tt><option></tt> tags, like <tt>options_from_collection_for_select</tt>, but
414+
# Returns a string of <tt><option></tt> tags, like #options_from_collection_for_select, but
415415
# groups them by <tt><optgroup></tt> tags based on the object relationships of the arguments.
416416
#
417417
# Parameters:
@@ -468,7 +468,7 @@ def option_groups_from_collection_for_select(collection, group_method, group_lab
468468
end.join.html_safe
469469
end
470470

471-
# Returns a string of <tt><option></tt> tags, like <tt>options_for_select</tt>, but
471+
# Returns a string of <tt><option></tt> tags, like #options_for_select, but
472472
# wraps them with <tt><optgroup></tt> tags:
473473
#
474474
# grouped_options = [

0 commit comments

Comments
 (0)