class Para::FormBuilder::Tabs::Tab
Attributes
Public Class Methods
Source
# File lib/para/form_builder/tabs.rb, line 63 def initialize(template, object, builder, identifier, options, index, &content_block) @template = template @object = object @builder = builder @identifier = identifier @content = capture { content_block.call } @icon = options[:icon] @active = options[:active] @index = index end
Public Instance Methods
Source
# File lib/para/form_builder/tabs.rb, line 97 def active? active == true || (active == nil && index == 0) end
Source
# File lib/para/form_builder/tabs.rb, line 82 def dom_id @dom_id = [ 'form-tab', object_name, builder.nested_resource_dom_id.presence, identifier.to_s.parameterize ].compact.join('-') end
Source
# File lib/para/form_builder/tabs.rb, line 91 def object_name if (name = builder.object_name.presence) name.to_s.parameterize end end
Source
# File lib/para/form_builder/tabs.rb, line 74 def title if Symbol === identifier ::I18n.t("forms.tabs.#{ object.class.model_name.i18n_key }.#{ identifier }") else identifier end end