Class: Magicka::Form

Inherits:
Aggregator show all
Defined in:
lib/magicka/form.rb

Overview

Class responsible for controlling one object form

Instance Attribute Summary

Attributes inherited from Aggregator

#model

Instance Method Summary collapse

Methods inherited from Aggregator

#equal?, #except, #initialize, #only, with_element, #with_model

Methods included from Aggregator::ClassMethods

#type, #with_element

Constructor Details

This class inherits a constructor from Magicka::Aggregator

Instance Method Details

#button(**args) ⇒ ActionView::OutputBuffer

Renders a button

Returns:

  • (ActionView::OutputBuffer)


12
13
14
# File 'lib/magicka/form.rb', line 12

def button(**args)
  Button.render(renderer: renderer, **args)
end

#input(field, model: self.model, **options) ⇒ ActionView::OutputBuffer

Parameters:

  • field (String, Symbol)

    field to be shown

  • model (String) (defaults to: self.model)

    model being rendered (when omited, use the aggregator model)

  • options (Hash)

Returns:

  • (ActionView::OutputBuffer)

See Also:



# File 'lib/magicka/form.rb', line 16

#select(field, model: self.model, **options) ⇒ ActionView::OutputBuffer

Parameters:

  • field (String, Symbol)

    field to be shown

  • model (String) (defaults to: self.model)

    model being rendered (when omited, use the aggregator model)

  • options (Hash)

Returns:

  • (ActionView::OutputBuffer)

See Also:



# File 'lib/magicka/form.rb', line 28