Class: Yattho::Forms::FormReference

Inherits:
BaseComponent show all
Defined in:
lib/yattho/forms/form_reference.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes included from ActsAsComponent

#template_root_path

Instance Method Summary collapse

Methods inherited from BaseComponent

#content, inherited, #input?, #perform_render, #render?, #to_component, #type

Methods included from ActsAsComponent

#compile!, extended, #renders_templates

Methods included from ClassNameHelper

#class_names

Constructor Details

#initialize(input:) ⇒ FormReference

Returns a new instance of FormReference.



9
10
11
# File 'lib/yattho/forms/form_reference.rb', line 9

def initialize(input:)
  @input = input
end

Instance Method Details

#builder_or_viewObject



13
14
15
# File 'lib/yattho/forms/form_reference.rb', line 13

def builder_or_view
  @input.nested? ? builder : @view_context
end