app/controllers/anoubis/etc/field.rb
##
# Return field properties for frontend application for action 'index'
# @param model [ActiveRecord] field's model
# @param action [Srting] current field action
# @return [Hash] field's properties for defined action
Return field properties for frontend application for action 'index'
Return field properties for frontend application for action ' index '
def properties_index (model, action)
        result = {
            id: self.key,
            type: self.type,
            sortable: self.order != nil
        }
        if self.title
          result[:title] = self.title
        else
          result[:title] = model.human_attribute_name(self.key)
        end
        result[:editable] = self.editable if self.editable != nil
        result[:editable] = false if self.type == 'key'
        result[:format] = self.format if self.type == 'datetime'
        result[:precision] = self.precision if self.type == 'number'
        result[:options] = self.hash_to_json(self.options.list) if self.options
        result
      end
def properties_index ( model , action ) result = { id : self . key , type : self . type , sortable : self . order != nil } if self . title result [ :title ] = self . title else result [ :title ] = model . human_attribute_name ( self . key ) end result [ :editable ] = self . editable if self . editable != nil result [ :editable ] = false if self . type == 'key' result [ :format ] = self . format if self . type == 'datetime' result [ :precision ] = self . precision if self . type == 'number' result [ :options ] = self . hash_to_json ( self . options . list ) if self . options result end
Return field properties for frontend application for action 'index'
Return field properties for frontend application for action ' index '
field's properties for defined action
field ' s properties for defined action
Hash
model
None
action
current field action
current field action