Class: Cocooned::Association::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/cocooned/association/renderer.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(template, form, association, object, options = {}) ⇒ Renderer

Returns a new instance of Renderer.



6
7
8
9
10
11
12
# File 'lib/cocooned/association/renderer.rb', line 6

def initialize(template, form, association, object, options = {})
  @template = template
  @form = form
  @association = association
  @object = object
  @options = options.dup.symbolize_keys
end

Instance Method Details

#renderObject



14
15
16
17
18
# File 'lib/cocooned/association/renderer.rb', line 14

def render
  form.public_send(form_method, association, object, form_options) do |form|
    template.render(partial, **render_options(form))
  end
end