Sha256: 2f80145d113e0a54f28d647e9f82b81971f408f85c612cd13520359dbd3daa42
Contents?: true
Size: 482 Bytes
Versions: 10
Compression:
Stored size: 482 Bytes
Contents
module FormsHelper def response_setup(form) # collect the default values together defaults = {} form.fields.collect{|f| defaults[f.underscored_name.to_sym] = f.default } unless form.nil? || form.fields.nil? Noodall::FormResponse.new(defaults) end def field_type(field) field_type = field._type.gsub(/^.*::/, '').downcase if field_type == "textfield" && field.rows > 1 field_type = "textarea" end return field_type end end
Version data entries
10 entries across 10 versions & 1 rubygems