Class: ActionView::Helpers::Tags::Base

Inherits:
Object
  • Object
show all
Includes:
ActiveModelInstanceTag, FormTagHelper, ActionView::Helpers::TagHelper
Defined in:
actionview/lib/action_view/helpers/tags/base.rb

Overview

:nodoc:

Constant Summary

Constants included from ActionView::Helpers::TagHelper

ActionView::Helpers::TagHelper::ARIA_PREFIXES, ActionView::Helpers::TagHelper::BOOLEAN_ATTRIBUTES, ActionView::Helpers::TagHelper::DATA_PREFIXES, ActionView::Helpers::TagHelper::PRE_CONTENT_STRINGS, ActionView::Helpers::TagHelper::TAG_TYPES

Constants included from ContentExfiltrationPreventionHelper

ContentExfiltrationPreventionHelper::CLOSE_CDATA_COMMENT, ContentExfiltrationPreventionHelper::CLOSE_FORM_TAG, ContentExfiltrationPreventionHelper::CLOSE_OPTION_TAG, ContentExfiltrationPreventionHelper::CLOSE_QUOTES_COMMENT, ContentExfiltrationPreventionHelper::CONTENT_EXFILTRATION_PREVENTION_MARKUP

Constants included from UrlHelper

UrlHelper::BUTTON_TAG_METHOD_VERBS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ActiveModelInstanceTag

#content_tag, #error_message, #error_wrapping, #tag

Methods included from ActionView::Helpers::TagHelper

build_tag_values, #cdata_section, #content_tag, #escape_once, #tag, #token_list

Methods included from OutputSafetyHelper

#raw, #safe_join, #to_sentence

Methods included from CaptureHelper

#capture, #content_for, #content_for?, #provide, #with_output_buffer

Methods included from FormTagHelper

#button_tag, #check_box_tag, #color_field_tag, #date_field_tag, #datetime_field_tag, #email_field_tag, #field_id, #field_name, #field_set_tag, #file_field_tag, #form_tag, #hidden_field_tag, #image_submit_tag, #label_tag, #month_field_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, #time_field_tag, #url_field_tag, #utf8_enforcer_tag, #week_field_tag

Methods included from ActiveSupport::Concern

#append_features, #class_methods, extended, #included, #prepend_features, #prepended

Methods included from ContentExfiltrationPreventionHelper

#prevent_content_exfiltration

Methods included from ActionView::Helpers::TextHelper

#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 UrlHelper

#button_to, #current_page?, #link_to, #link_to_if, #link_to_unless, #link_to_unless_current, #mail_to, #phone_to, #sms_to, #url_for

Constructor Details

#initialize(object_name, method_name, template_object, options = {}) ⇒ Base

Returns a new instance of Base.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'actionview/lib/action_view/helpers/tags/base.rb', line 11

def initialize(object_name, method_name, template_object, options = {})
  @object_name, @method_name = object_name.to_s.dup, method_name.to_s.dup
  @template_object = template_object

  @object_name.sub!(/\[\]$/, "") || @object_name.sub!(/\[\]\]$/, "]")
  @object = retrieve_object(options.delete(:object))
  @skip_default_ids = options.delete(:skip_default_ids)
  @allow_method_names_outside_object = options.delete(:allow_method_names_outside_object)
  @options = options

  if Regexp.last_match
    @generate_indexed_names = true
    @auto_index = retrieve_autoindex(Regexp.last_match.pre_match)
  else
    @generate_indexed_names = false
    @auto_index = nil
  end
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



9
10
11
# File 'actionview/lib/action_view/helpers/tags/base.rb', line 9

def object
  @object
end

Instance Method Details

#renderObject

This is what child classes implement.

Raises:

  • (NotImplementedError)


31
32
33
# File 'actionview/lib/action_view/helpers/tags/base.rb', line 31

def render
  raise NotImplementedError, "Subclasses must implement a render method"
end