Here you go. Views are absolutely not my strong suite, I feel much better deep in the backend.
CsvUpload has a mapping attribute, but not field_name or field_type
#columns
= simple_form_for :csv_upload, url: wizard_path, method: :put do |f|
- @columns.each_with_index do |column, i|
div id="column_#{i.to_s}"
= f.input :mapping, collection: @select_options, include_blank: false, selected: @mapping[i], :input_html => { name: "mapping[#{i}]" }, label: "Column #{i + 1} : #{column.humanize}"
.new_custom_field
= f.input :field_name, :input_html => { name: "field_name[#{i}]"}
= f.input :field_type, collection: ["Text", "Date", "Number"], :input_html => { name: "field_type[#{i}]"}
= f.submit "Import!"
On Wednesday, June 13, 2012 2:23:03 PM UTC+1, Rafael Mendonça França wrote:
Can you provide an example of what you are trying to do?