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

Version Path
noodall-form-builder-0.4.2 app/helpers/forms_helper.rb
noodall-form-builder-0.4.1 app/helpers/forms_helper.rb
noodall-form-builder-0.4.0 app/helpers/forms_helper.rb
noodall-form-builder-0.3.3 app/helpers/forms_helper.rb
noodall-form-builder-0.2.11 app/helpers/forms_helper.rb
noodall-form-builder-0.3.2 app/helpers/forms_helper.rb
noodall-form-builder-0.3.1 app/helpers/forms_helper.rb
noodall-form-builder-0.3.0 app/helpers/forms_helper.rb
noodall-form-builder-0.2.10 app/helpers/forms_helper.rb
noodall-form-builder-0.2.9 app/helpers/forms_helper.rb