From a17a1f89101daf16a9229fee52325d74eeebec40 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 27 Apr 2017 11:21:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=A7=E8=A1=8C=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/_form.html.erb | 4 ++++ app/views/challenges/show.html.erb | 6 ++++++ db/migrate/20170427031044_add_exec_path_to_challenges.rb | 5 +++++ 3 files changed, 15 insertions(+) create mode 100644 db/migrate/20170427031044_add_exec_path_to_challenges.rb diff --git a/app/views/challenges/_form.html.erb b/app/views/challenges/_form.html.erb index a97f6144d..5906c63d5 100644 --- a/app/views/challenges/_form.html.erb +++ b/app/views/challenges/_form.html.erb @@ -85,6 +85,10 @@ <%= f.text_field :path, :class => "panel-form-width-690 panel-box-sizing fl", :no_label => true, :placeholder => "进入实训后将默认打开该文件,如:app/controllers/welcome_controller.rb", :maxlength => "256" %> +
  • + + <%= f.text_field :exec_path, :class => "panel-form-width-690 panel-box-sizing fl", :no_label => true, :placeholder => "输入关卡需要执行的文件路径,如:app/controllers/welcome_controller.rb", :maxlength => "256" %> +
  • diff --git a/app/views/challenges/show.html.erb b/app/views/challenges/show.html.erb index 13d2158c4..98d8cfcdc 100644 --- a/app/views/challenges/show.html.erb +++ b/app/views/challenges/show.html.erb @@ -52,6 +52,12 @@ <%= @challenge.path.blank? ? "无" : (h @challenge.path.html_safe) %>
  • +
  • + +
    + <%= @challenge.exec_path.blank? ? "无" : (h @challenge.exec_path) %> +
    +
  • diff --git a/db/migrate/20170427031044_add_exec_path_to_challenges.rb b/db/migrate/20170427031044_add_exec_path_to_challenges.rb new file mode 100644 index 000000000..e9aaa7076 --- /dev/null +++ b/db/migrate/20170427031044_add_exec_path_to_challenges.rb @@ -0,0 +1,5 @@ +class AddExecPathToChallenges < ActiveRecord::Migration + def change + add_column :challenges, :exec_path, :string + end +end