Class: Super::Form
- Inherits:
-
Object
- Object
- Super::Form
- Includes:
- Schema::Common
- Defined in:
- lib/super/form.rb,
lib/super/form/guesser.rb,
lib/super/form/schema_types.rb,
lib/super/form/inline_errors.rb,
lib/super/form/strong_params.rb,
lib/super/form/field_transcript.rb
Overview
This schema type is used on your +#edit+ and +#new+ forms
class MembersController::Controls
# ...
def new_schema
Super::Form.new do |fields, type|
fields[:name] = type.string
fields[:rank] = type.select
fields[:position] = type.string
fields[:ship_id] = type.select(
collection: Ship.all.map { |s| ["#{s.name} (Ship ##{s.id})", s.id] },
)
end
end
# ...
end
Defined Under Namespace
Modules: InlineErrors Classes: FieldTranscript, Guesser, SchemaTypes, StrongParams
Instance Method Summary collapse
-
#initialize {|@fields, @schema_types| ... } ⇒ Form
constructor
A new instance of Form.
- #to_partial_path ⇒ Object
Methods included from Schema::Common
#each_attribute, #each_attribute_name
Constructor Details
Instance Method Details
#to_partial_path ⇒ Object
33 34 35 |
# File 'lib/super/form.rb', line 33 def to_partial_path "form" end |