tramway-admin 1.12 → 1.12.0.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9eae42074a988ca816a21d71c0f9c6d3ac0b46f31399f6da7091fbfd408f7f17
|
4
|
+
data.tar.gz: c56b19d4085c23245827bba64e7e56f62074b6d2a42e51d329bd37f08b4c206f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 998547d17902ac7ac720647bab7b53eb382a30df2e375d6b77febbe9742a0feafe51fa7f914d520f80cda0db12e72da2d390d11ee2eca903fd7750abb684275d
|
7
|
+
data.tar.gz: 21d83f7463ea824b958c3ea8f8efb9813cc6134bd6380999d79128833e4557c63aa2ac1ff4668800e22011e033cb74b9240343fb4258af79f1a4eedd29105339
|
@@ -1,65 +1,63 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
end
|
1
|
+
class Tramway::Admin::RecordsController < ::Tramway::Admin::ApplicationController
|
2
|
+
def index
|
3
|
+
scope = params[:scope].present? ? params[:scope] : :all
|
4
|
+
records = model_class.active.order(id: :desc).send scope
|
5
|
+
records = records.search params[:search] if params[:search]
|
6
|
+
@records = decorator_class.decorate records.page params[:page]
|
7
|
+
end
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
def show
|
10
|
+
@record = decorator_class.decorate model_class.active.find params[:id]
|
11
|
+
end
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
def edit
|
14
|
+
@record_form = form_class.new model_class.active.find params[:id]
|
15
|
+
end
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
17
|
+
def update
|
18
|
+
@record_form = form_class.new model_class.active.find params[:id]
|
19
|
+
if @record_form.submit params[:record]
|
20
|
+
redirect_to params[:redirect] || record_path(@record_form.model)
|
21
|
+
else
|
22
|
+
render :edit
|
25
23
|
end
|
24
|
+
end
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
def new
|
27
|
+
@record_form = form_class.new model_class.new
|
28
|
+
end
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
30
|
+
def create
|
31
|
+
@record_form = form_class.new
|
32
|
+
if @record_form.submit params[:record]
|
33
|
+
redirect_to params[:redirect] || record_path(@record_form.model)
|
34
|
+
else
|
35
|
+
render :new
|
38
36
|
end
|
37
|
+
end
|
39
38
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
39
|
+
def destroy
|
40
|
+
record = model_class.active.find params[:id]
|
41
|
+
record.remove
|
42
|
+
redirect_to records_path
|
45
43
|
end
|
44
|
+
end
|
46
45
|
|
47
|
-
|
46
|
+
private
|
48
47
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
# FIXME replace to module
|
49
|
+
def record_path(*args, **options)
|
50
|
+
super args, options.merge(model: params[:model])
|
51
|
+
end
|
53
52
|
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
def edit_record_path(*args, **options)
|
54
|
+
super args, options.merge(model: params[:model])
|
55
|
+
end
|
57
56
|
|
58
|
-
|
59
|
-
|
60
|
-
|
57
|
+
def new_record_path(*args, **options)
|
58
|
+
super args, options.merge(model: params[:model])
|
59
|
+
end
|
61
60
|
|
62
|
-
|
63
|
-
|
64
|
-
end
|
61
|
+
def records_path(*args, **options)
|
62
|
+
super args, options.merge(model: params[:model])
|
65
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.12.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap-kaminari-views
|
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
272
272
|
version: '0'
|
273
273
|
requirements: []
|
274
274
|
rubyforge_project:
|
275
|
-
rubygems_version: 2.7.
|
275
|
+
rubygems_version: 2.7.7
|
276
276
|
signing_key:
|
277
277
|
specification_version: 4
|
278
278
|
summary: Engine for admin
|