lib/scaffolding_extensions/model/sequel.rb
# Returns the list of fields to display on the scaffolded forms. Defaults
# to displaying all columns with the exception of the primary key column.
# Also includes :many_to_one associations, replacing
# the foriegn keys with the association itself.  Can be set with an instance variable.
Returns the list of fields to display on the scaffolded forms. Defaults
to displaying all columns with the exception of the primary key column.
Also includes :many_to_one associations, replacing
the foriegn keys with the association itself.  Can be set with an instance variable.
Returns the list of fields to display on the scaffolded forms . Defaults to displaying all columns with the exception of the primary key column . Also includes : many_to_one associations replacing the foriegn keys with the association itself . Can be set with an instance variable .
def scaffold_fields(action = :default)
    return @scaffold_fields if @scaffold_fields
    fields = columns - [primary_key]
    all_association_reflections.each do |reflection|
      next unless reflection[:type] == :many_to_one
      fields.delete(reflection[:key].to_sym)
      fields.push(reflection[:name])
    end
    @scaffold_fields = fields.sort_by{|f| f.to_s}
  end
def scaffold_fields ( action = :default ) return @scaffold_fields if @scaffold_fields fields = columns - [ primary_key ] all_association_reflections . each do | reflection | next unless reflection [ :type ] == :many_to_one fields . delete ( reflection [ :key ] . to_sym ) fields . push ( reflection [ :name ] ) end @scaffold_fields = fields . sort_by { | f | f . to_s } end
Returns the list of fields to display on the scaffolded forms.
Returns the list of fields to display on the scaffolded forms .
action
<not_specific>