trailguide 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/trail_guide/admin/experiments_controller.rb +2 -2
- data/app/controllers/trail_guide/{application_controller.rb → experiments_controller.rb} +1 -1
- data/config/routes.rb +17 -3
- data/lib/trail_guide/admin/engine.rb +0 -2
- data/lib/trail_guide/version.rb +1 -1
- metadata +2 -3
- data/config/admin/routes.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f039c1544c6c7838e9cbfcbed1c055695c9858410c4691e4610c0d01a3f4641a
|
4
|
+
data.tar.gz: 0352f018c0b28e12ab7ad1240601d30efbc3128060ddff71a0bb71ab62f0bcbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f98583d74689f359af53deaacc3ec9423724353207c18051a3502b7b247acda71f74c44020b7cf99995cd64bdfa0063b6f4737d2c38f0aa96eec50bed62a7e8d
|
7
|
+
data.tar.gz: 0e3905af90fee8378ced8c729da4a5d2f127208b4fb6e26cdfc1a07b6376486373ec36ca825fb9fad52056b72e0d4f0b40b30c185681280b060ff14553f11b74
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module TrailGuide
|
2
2
|
module Admin
|
3
|
-
class ExperimentsController <
|
3
|
+
class ExperimentsController < ApplicationController
|
4
4
|
before_action except: [:index] do
|
5
5
|
(redirect_to :back rescue redirect_to trail_guide_admin.experiments_path) and return unless experiment.present?
|
6
6
|
end
|
@@ -29,7 +29,7 @@ module TrailGuide
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def winner
|
32
|
-
experiment.declare_winner!(params[:
|
32
|
+
experiment.declare_winner!(params[:variant])
|
33
33
|
redirect_to :back rescue redirect_to trail_guide_admin.experiments_path
|
34
34
|
end
|
35
35
|
|
data/config/routes.rb
CHANGED
@@ -1,10 +1,24 @@
|
|
1
1
|
TrailGuide::Engine.routes.draw do
|
2
|
-
get '/:experiment_name' => '
|
2
|
+
get '/:experiment_name' => 'experiments#choose',
|
3
3
|
defaults: { format: :json }
|
4
|
-
match '/:experiment_name' => '
|
4
|
+
match '/:experiment_name' => 'experiments#convert',
|
5
5
|
defaults: { format: :json },
|
6
6
|
via: [:put, :post]
|
7
|
-
match '/:experiment_name/:checkpoint' => '
|
7
|
+
match '/:experiment_name/:checkpoint' => 'experiments#convert',
|
8
8
|
defaults: { format: :json },
|
9
9
|
via: [:put, :post]
|
10
10
|
end
|
11
|
+
|
12
|
+
if defined?(TrailGuide::Admin::Engine)
|
13
|
+
TrailGuide::Admin::Engine.routes.draw do
|
14
|
+
resources :experiments, path: '/', only: [:index] do
|
15
|
+
member do
|
16
|
+
match :start, via: [:put, :post, :get]
|
17
|
+
match :stop, via: [:put, :post, :get]
|
18
|
+
match :reset, via: [:put, :post, :get]
|
19
|
+
match :restart, via: [:put, :post, :get]
|
20
|
+
match :winner, via: [:put, :post, :get], path: 'winner/:variant'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/trail_guide/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailguide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rebec
|
@@ -108,11 +108,10 @@ files:
|
|
108
108
|
- app/assets/stylesheets/trail_guide/admin/application.css
|
109
109
|
- app/controllers/trail_guide/admin/application_controller.rb
|
110
110
|
- app/controllers/trail_guide/admin/experiments_controller.rb
|
111
|
-
- app/controllers/trail_guide/
|
111
|
+
- app/controllers/trail_guide/experiments_controller.rb
|
112
112
|
- app/views/layouts/trail_guide/admin/application.html.erb
|
113
113
|
- app/views/trail_guide/admin/experiments/_experiment.html.erb
|
114
114
|
- app/views/trail_guide/admin/experiments/index.html.erb
|
115
|
-
- config/admin/routes.rb
|
116
115
|
- config/routes.rb
|
117
116
|
- lib/trail_guide/adapters.rb
|
118
117
|
- lib/trail_guide/adapters/participants.rb
|
data/config/admin/routes.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
TrailGuide::Admin::Engine.routes.draw do
|
2
|
-
resources :experiments, path: '/', only: [:index] do
|
3
|
-
member do
|
4
|
-
match :start, via: [:put, :post, :get]
|
5
|
-
match :stop, via: [:put, :post, :get]
|
6
|
-
match :reset, via: [:put, :post, :get]
|
7
|
-
match :restart, via: [:put, :post, :get]
|
8
|
-
match 'winner/:winner', action: :winner, as: :winner, via: [:put, :post, :get]
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|