| Module | ExtJS::Model::InstanceMethods |
| In: |
lib/model/base.rb
|
Converts a model instance to a record compatible with ExtJS
The first parameter should be the fieldset for which the record will be returned. If no parameter is provided, then the default fieldset will be choosen Alternativly the first parameter can be a Hash with a :fields member to directly specify the fields to use for the record.
All these are valid calls:
user.to_record # returns record for :default fieldset
# (fieldset is autmatically defined, if not set)
user.to_record :fieldset # returns record for :fieldset fieldset
# (fieldset is autmatically defined, if not set)
user.to_record :fields => [:id, :password]
# returns record for the fields 'id' and 'password'
For even more valid options for this method (which all should not be neccessary to use) have a look at ExtJS::Model::Util.extract_fieldset_and_options