Hi, I am using the FormHelper to build a form. The default control for String properties seems to a <input/> field, but for some properties I want to use <textarea/> fields.
How can I customize this??
(1 attempts)
Kashia answered:
An example:
class User property :name, String, :control => :string property :description, String, :control => :textarea end
:string is the default setting for Strings.
Complete list of current :controls:
setting :control_map, :doc => 'Mappings of control names to controls', :default => { :fixnum => FixnumControl, :integer => FixnumControl, :float => FloatControl, :true_class => CheckboxControl, :boolean => CheckboxControl, :checkbox => CheckboxControl, :string => TextControl, :password => PasswordControl, :textarea => TextareaControl, :file => FileControl, :webfile => FileControl, :options => OptionsControl, :refers_to => RefersToControl, :has_one => RefersToControl, :belongs_to => RefersToControl, :has_many => HasManyControl, :many_to_many => HasManyControl, :joins_many => HasManyControl }
This list can be retrieved at runtime using:
p Nitro::FormHelper::FormXmlBuilder.control_map