lib/scaffolding_extensions/meta_model.rb
# Returns a completely blank object suitable for searching, updated with the given attributes.
Returns a completely blank object suitable for searching, updated with the given attributes.
Returns a completely blank object suitable for searching updated with the given attributes .
def scaffold_search_object(attributes = {})
    object = new
    scaffold_attributes(:search).each{|field| object.send("#{field}=", nil) unless object.send(field) == nil}
    h = {}
    attributes.each {|k,v| h[k] = v unless v.to_s.strip.empty?}
    scaffold_set_attributes(object, h)
    object
  end
def scaffold_search_object ( attributes = { } ) object = new scaffold_attributes ( :search ) . each { | field | object . send ( "#{field}=" , nil ) unless object . send ( field ) == nil } h = { } attributes . each { | k , v | h [ k ] = v unless v . to_s . strip . empty? } scaffold_set_attributes ( object , h ) object end
Returns a completely blank object suitable for searching, updated with the given attributes.
Returns a completely blank object suitable for searching updated with the given attributes .
# Blank any fields set by default # Don't set any fields left blank by the user
attributes
<not_specific>