Class: ActionView::Helpers::InstanceTag
- Inherits:
-
Object
- Object
- ActionView::Helpers::InstanceTag
- Defined in:
- lib/action_view/helpers/date_helper.rb,
lib/action_view/helpers/form_helper.rb,
lib/action_view/helpers/active_model_helper.rb,
lib/action_view/helpers/form_options_helper.rb
Overview
:nodoc:
Constant Summary
Constants included from InstanceTagMethods
ActionView::Helpers::InstanceTagMethods::DEFAULT_FIELD_OPTIONS, ActionView::Helpers::InstanceTagMethods::DEFAULT_RADIO_OPTIONS, ActionView::Helpers::InstanceTagMethods::DEFAULT_TEXT_AREA_OPTIONS
Constants included from TagHelper
Instance Attribute Summary
Attributes included from InstanceTagMethods
Attributes included from Context
Instance Method Summary collapse
- #to_collection_select_tag(collection, value_method, text_method, options, html_options) ⇒ Object
- #to_date_select_tag(options = {}, html_options = {}) ⇒ Object
- #to_datetime_select_tag(options = {}, html_options = {}) ⇒ Object
- #to_grouped_collection_select_tag(collection, group_method, group_label_method, option_key_method, option_value_method, options, html_options) ⇒ Object
- #to_select_tag(choices, options, html_options) ⇒ Object
- #to_time_select_tag(options = {}, html_options = {}) ⇒ Object
- #to_time_zone_select_tag(priority_zones, options, html_options) ⇒ Object
Methods included from FormOptionsHelper
#collection_select, #grouped_collection_select, #grouped_options_for_select, #option_groups_from_collection_for_select, #options_for_select, #options_from_collection_for_select, #select, #time_zone_options_for_select, #time_zone_select
Methods included from TextHelper
#auto_link, #concat, #current_cycle, #cycle, #excerpt, #highlight, #pluralize, #reset_cycle, #safe_concat, #simple_format, #truncate, #word_wrap
Methods included from SanitizeHelper
#sanitize, #sanitize_css, #strip_links, #strip_tags
Methods included from ActiveModelInstanceTag
#error_message, #error_wrapping, #object, #tag
Methods included from InstanceTagMethods
#initialize, #object, #to_boolean_select_tag, #to_check_box_tag, #to_content_tag, #to_input_field_tag, #to_label_tag, #to_number_field_tag, #to_radio_button_tag, #to_text_area_tag, #value, #value_before_type_cast
Methods included from CaptureHelper
#capture, #content_for, #content_for?, #flush_output_buffer, #with_output_buffer
Methods included from Context
Methods included from TagHelper
#cdata_section, #content_tag, #escape_once, #tag
Methods included from FormTagHelper
#check_box_tag, #email_field_tag, #field_set_tag, #file_field_tag, #form_tag, #hidden_field_tag, #image_submit_tag, #label_tag, #number_field_tag, #password_field_tag, #radio_button_tag, #range_field_tag, #search_field_tag, #select_tag, #submit_tag, #telephone_field_tag, #text_area_tag, #text_field_tag, #url_field_tag
Methods included from UrlHelper
#button_to, #current_page?, #link_to, #link_to_if, #link_to_unless, #link_to_unless_current, #mail_to, #url_for, #url_options
Methods included from ActionDispatch::Routing::UrlFor
Methods included from ActionDispatch::Routing::PolymorphicRoutes
#polymorphic_path, #polymorphic_url
Instance Method Details
#to_collection_select_tag(collection, value_method, text_method, options, html_options) ⇒ Object
564 565 566 567 568 569 570 571 572 573 |
# File 'lib/action_view/helpers/form_options_helper.rb', line 564 def to_collection_select_tag(collection, value_method, text_method, , ) = .stringify_keys add_default_name_and_id() value = value(object) disabled_value = .has_key?(:disabled) ? [:disabled] : nil selected_value = .has_key?(:selected) ? [:selected] : value content_tag( "select", ((collection, value_method, text_method, :selected => selected_value, :disabled => disabled_value), , value), ) end |
#to_date_select_tag(options = {}, html_options = {}) ⇒ Object
913 914 915 |
# File 'lib/action_view/helpers/date_helper.rb', line 913 def to_date_select_tag( = {}, = {}) datetime_selector(, ).select_date.html_safe end |
#to_datetime_select_tag(options = {}, html_options = {}) ⇒ Object
921 922 923 |
# File 'lib/action_view/helpers/date_helper.rb', line 921 def to_datetime_select_tag( = {}, = {}) datetime_selector(, ).select_datetime.html_safe end |
#to_grouped_collection_select_tag(collection, group_method, group_label_method, option_key_method, option_value_method, options, html_options) ⇒ Object
575 576 577 578 579 580 581 582 |
# File 'lib/action_view/helpers/form_options_helper.rb', line 575 def to_grouped_collection_select_tag(collection, group_method, group_label_method, option_key_method, option_value_method, , ) = .stringify_keys add_default_name_and_id() value = value(object) content_tag( "select", (option_groups_from_collection_for_select(collection, group_method, group_label_method, option_key_method, option_value_method, value), , value), ) end |
#to_select_tag(choices, options, html_options) ⇒ Object
555 556 557 558 559 560 561 562 |
# File 'lib/action_view/helpers/form_options_helper.rb', line 555 def to_select_tag(choices, , ) = .stringify_keys add_default_name_and_id() value = value(object) selected_value = .has_key?(:selected) ? [:selected] : value disabled_value = .has_key?(:disabled) ? [:disabled] : nil content_tag("select", ((choices, :selected => selected_value, :disabled => disabled_value), , selected_value), ) end |
#to_time_select_tag(options = {}, html_options = {}) ⇒ Object
917 918 919 |
# File 'lib/action_view/helpers/date_helper.rb', line 917 def to_time_select_tag( = {}, = {}) datetime_selector(, ).select_time.html_safe end |
#to_time_zone_select_tag(priority_zones, options, html_options) ⇒ Object
584 585 586 587 588 589 590 591 592 593 594 |
# File 'lib/action_view/helpers/form_options_helper.rb', line 584 def to_time_zone_select_tag(priority_zones, , ) = .stringify_keys add_default_name_and_id() value = value(object) content_tag("select", ( (value || [:default], priority_zones, [:model] || ActiveSupport::TimeZone), , value ), ) end |