Export/import elements added to the page
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
Reference in New Issue
Block a user