tramway-admin 1.31.0.1 → 1.31.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +18 -0
- data/app/controllers/tramway/admin/application_controller.rb +1 -1
- data/lib/tramway/admin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85b6f6446c7992da10f8047f5307cde053f95c0cddbecd3fb8452b54b1e1f275
|
4
|
+
data.tar.gz: f1c47470978a8da9341e5cde7327f6561bdfda5f2ea8629779457ca3994f33b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04655db55e12c76dc60edf28cf11c9e3cc73cc3256646e02363e4793522aed373300aea0c0af9391bf5a92f01391f5b72b9893426a4d7cac5eb33b9b3eb9758c
|
7
|
+
data.tar.gz: b529d3b27ce0c0a9288df0282ae0ca979ad6363446cef0cd6771b5e0279a3a42987126fc093dea569cb76ba84f48aea24bef5813ef1ef2ac19beefe099fac063
|
data/README.md
CHANGED
@@ -140,6 +140,24 @@ class Admin::YourModelForm < Tramway::Core::ApplicationForm
|
|
140
140
|
end
|
141
141
|
end
|
142
142
|
```
|
143
|
+
|
144
|
+
### 12. You can add search to your index page
|
145
|
+
|
146
|
+
Tramway use gem [PgSearch](https://github.com/Casecommons/pg_search`) as search engine
|
147
|
+
|
148
|
+
Just add `search` method to `YourModel` like this
|
149
|
+
|
150
|
+
```ruby
|
151
|
+
search_by *attributes, **associations # `attributes` and `associations` should be the same syntax as in PgSearch
|
152
|
+
```
|
153
|
+
|
154
|
+
Example:
|
155
|
+
|
156
|
+
```ruby
|
157
|
+
class YourModel < Tramway::Core::ApplicationRecord
|
158
|
+
search_by :my_attribute, :another_attribute, my_association: [ :my_association_attribute, :another_my_association_attribute ]
|
159
|
+
```
|
160
|
+
|
143
161
|
#### 12. Run server `rails s`
|
144
162
|
#### 13. Launch `localhost:3000/admin`
|
145
163
|
|
@@ -97,7 +97,7 @@ module Tramway
|
|
97
97
|
# model: params[:model]
|
98
98
|
# )
|
99
99
|
# raise "Looks like model #{params[:model]} is not included to tramway-admin for `#{current_admin.role}` role. Add it in the `config/initializers/tramway.rb`. This way `Tramway::Admin.set_available_models(#{params[:model]})`"
|
100
|
-
Tramway::Admin.forms.include? params[:form].underscore.sub(%r{^admin/}, '').sub(/_form$/, '')
|
100
|
+
Tramway::Admin.forms.include? params[:form].underscore.sub(%r{^admin/}, '').sub(/_form$/, '') if params[:form].present?
|
101
101
|
end
|
102
102
|
|
103
103
|
def available_scope_given?
|
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: 1.31.0.
|
4
|
+
version: 1.31.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap-kaminari-views
|