Method: Form#select
- Defined in:
- lib/make/form.rb
#select(column, array, assoc = false) ⇒ Object
Similar to default, but instead of a hidden specific value you pass in an array and create a select/option field.
66 67 68 69 70 71 72 73 74 |
# File 'lib/make/form.rb', line 66 def select column, array, assoc = false columnName = column.titleize input = "\n\t<label>" + columnName + "\n\t</label>\n\t<select name=\"" + @modelName + "[" + column + "]\">" input += "\n\t\t\t<option value=\"" + item.to_s + "\">" + item.to_s + "</option>" @potential_keys_to_ignore.push(column) input += "\n\t</select>" @formMiddle.push(input) return self end |