lib/scaffolding_extensions/model/active_record.rb
def scaffold_new_associated_object_values(association, record)
    reflection = reflect_on_association(association)
    vals = {reflection.foreign_key=>record.id}
    vals["#{reflection.options[:as]}_type"] = name if reflection.options.include?(:as)
    vals
  end
# Returns a hash of values to be used as url parameters on the link to create a new
# :has_many associated object.  Defaults to setting the foreign key field to the
# record's primary key, and the STI type to this model's name, if :as is one of
# the association's reflection's options.
Returns a hash of values to be used as url parameters on the link to create a new
:has_many associated object.  Defaults to setting the foreign key field to the
record's primary key, and the STI type to this model's name, if :as is one of
the association's reflection's options.
Returns a hash of values to be used as url parameters on the link to create a new : has_many associated object . Defaults to setting the foreign key field to the record ' s primary key and the STI type to this model ' s name if : as is one of the association ' s reflection ' s options .
def scaffold_new_associated_object_values(association, record)
    reflection = reflect_on_association(association)
    vals = {reflection.foreign_key=>record.id}
    vals["#{reflection.options[:as]}_type"] = name if reflection.options.include?(:as)
    vals
  end
def scaffold_new_associated_object_values ( association , record ) reflection = reflect_on_association ( association ) vals = { reflection . foreign_key => record . id } vals [ "#{reflection.options[:as]}_type" ] = name if reflection . options . include? ( :as ) vals end
Returns a hash of values to be used as url parameters on the link to create a new
:has_many associated object.
Returns a hash of values to be used as url parameters on the link to create a new : has_many associated object .
association
record