Created
September 17, 2012 21:47
-
-
Save scottshea/3739990 to your computer and use it in GitHub Desktop.
Partial with select changing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for :asset, :url => {:controller => "import", :action => "asset_check", :format => :js }, :options => { :remote => true }, :html => {:method => :post, :class => "well form-horizontal"} do |f| %> | |
<%= f.submit "Check File", :class => "btn" %> </br> | |
<%= f.label 'Configuration', "Field Mapping:", :class => "control-label" %> | |
<div class="controls"> | |
<%= f.select('csv_configurations', options_from_collection_for_select(@csv_configurations, "id", "name"), {:include_blank => true}, {:id => "csv_configuration", :onchange => "load_mapping(this.value)"}) %> | |
</div> | |
<% @csv.headers.each do |head| %> | |
<%= f.label head, head.humanize, :class => "control-label", :id => "#{head}_id" %> | |
<div class="controls"> | |
<% if @format %> | |
<%= f.select head, options_for_select(@asset_attrs,@mappings.find {|map| map.csv_field_name == head}.model_field_name) %> | |
<p>Meow</p> | |
<% else %> | |
<%= f.select head, options_for_select(["Choose Cetani field"] + @asset_attrs, "Choose Cetani field") %> | |
<% end %> | |
</div> | |
<% end %> | |
<%= f.hidden_field 'file', :value => @csv %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment