Export/import elements added to the page

This commit is contained in:
Adam
2015-12-30 22:52:51 +01:00
parent 93a315bbe1
commit 1dcd8d404e
2 changed files with 21 additions and 1 deletions

View File

@@ -33,6 +33,8 @@ class ItemsController < ApplicationController
end
def export_import
@tasks = [ ["Validate items", "validate_items"],
["Import items", "import_items"],
["Update prices", "update_prices"] ]
end
end

View File

@@ -1 +1,19 @@
<%= form_tag('./export_import') do %>
<p><label for="codes">
CSV content goes here:
</label><br />
<%= text_area_tag "csv_content", @csv_content, rows: 20, cols: 70 %></p>
<p><label for="task">Task: </label>
<%= select_tag "task", options_for_select(@tasks) %></p>
<p><%= submit_tag "Run task" %></p>
<% if !@error_message.nil? && @error_message != "" %>
<div>Error message: <span style="color: red"><%= @error_message %></span></div>
<% end %>
<br />
<p><label for="output_area">Output area: </label>
<div id="output_area" style="width: 36.4em;height: 14em;outline: 1px solid #A9A9A9;"></div>
<% end %>