Class: Trestle::Form
- Inherits:
-
Object
- Object
- Trestle::Form
- Extended by:
- ActiveSupport::Autoload
- Defined in:
- lib/trestle/form.rb,
lib/trestle/form/field.rb,
lib/trestle/form/fields.rb,
lib/trestle/form/builder.rb,
lib/trestle/form/renderer.rb,
lib/trestle/form/automatic.rb,
lib/trestle/form/fields/select.rb,
lib/trestle/form/fields/check_box.rb,
lib/trestle/form/fields/file_field.rb,
lib/trestle/form/fields/form_group.rb,
lib/trestle/form/fields/tag_select.rb,
lib/trestle/form/fields/date_select.rb,
lib/trestle/form/fields/range_field.rb,
lib/trestle/form/fields/time_select.rb,
lib/trestle/form/fields/form_control.rb,
lib/trestle/form/fields/radio_button.rb,
lib/trestle/form/fields/static_field.rb,
lib/trestle/form/fields/datetime_select.rb,
lib/trestle/form/fields/time_zone_select.rb,
lib/trestle/form/fields/check_box_helpers.rb,
lib/trestle/form/fields/collection_select.rb,
lib/trestle/form/fields/radio_button_helpers.rb,
lib/trestle/form/fields/collection_check_boxes.rb,
lib/trestle/form/fields/collection_radio_buttons.rb,
lib/trestle/form/fields/grouped_collection_select.rb
Direct Known Subclasses
Defined Under Namespace
Modules: Fields Classes: Automatic, Builder, Field, Renderer
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #dialog? ⇒ Boolean
-
#initialize(options = {}, &block) ⇒ Form
constructor
A new instance of Form.
- #render(template, instance) ⇒ Object
Constructor Details
#initialize(options = {}, &block) ⇒ Form
Returns a new instance of Form.
13 14 15 |
# File 'lib/trestle/form.rb', line 13 def initialize(={}, &block) @options, @block = , block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
11 12 13 |
# File 'lib/trestle/form.rb', line 11 def block @block end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/trestle/form.rb', line 11 def @options end |
Instance Method Details
#dialog? ⇒ Boolean
17 18 19 |
# File 'lib/trestle/form.rb', line 17 def dialog? [:dialog] == true end |
#render(template, instance) ⇒ Object
21 22 23 |
# File 'lib/trestle/form.rb', line 21 def render(template, instance) Renderer.new(template).render_form(instance, &block) end |