From 1dcd8d404e4abf04b7449b03b0b300b746fcade9 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 30 Dec 2015 22:52:51 +0100 Subject: [PATCH] Export/import elements added to the page --- .../app/controllers/items_controller.rb | 4 +++- .../app/views/items/export_import.html.erb | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/back-office/app/controllers/items_controller.rb b/back-office/app/controllers/items_controller.rb index 23394a9..132550c 100644 --- a/back-office/app/controllers/items_controller.rb +++ b/back-office/app/controllers/items_controller.rb @@ -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 diff --git a/back-office/app/views/items/export_import.html.erb b/back-office/app/views/items/export_import.html.erb index 8b13789..0b2ed4c 100644 --- a/back-office/app/views/items/export_import.html.erb +++ b/back-office/app/views/items/export_import.html.erb @@ -1 +1,19 @@ +<%= form_tag('./export_import') do %> +


+ <%= text_area_tag "csv_content", @csv_content, rows: 20, cols: 70 %>

+

+ <%= select_tag "task", options_for_select(@tasks) %>

+ +

<%= submit_tag "Run task" %>

+ + <% if !@error_message.nil? && @error_message != "" %> +
Error message: <%= @error_message %>
+ <% end %> + +
+

+

+<% end %>