active_admin_simple_life 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/active_admin_simple_life/menu_elements.rb +3 -2
- data/lib/active_admin_simple_life/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec370d39c1fce84d4b123e3982d8580b7661ce49
|
4
|
+
data.tar.gz: 6c07a7aa138f48521a33ccb1355d5db513ae44d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1665c975a59f4f4193af1fe98351d15e93739e7ca1a922fc56c00fc2111bf5dd852cc89c49fa95c08e9d619c9e376617dff3ee0ea9052c1294b04945abd3dc5d
|
7
|
+
data.tar.gz: 1487d207ab79a3b19ddc455a357ecdb1fe9b35f3581a180bbf3d5a552405fcbfbad03ac641f58de7f35a0a79fb72ab2b511b4c10a6aaf5993acc72e800bd2160
|
data/README.md
CHANGED
@@ -53,6 +53,7 @@ Parts of `simple_menu_for` may be used for other purposes with:
|
|
53
53
|
* `index_for_main_fields klass, options`, where options are:
|
54
54
|
1. `:max_length` - max length of field. Integer
|
55
55
|
2. `:add` - extra fields, which will be added in index. Symbol or Array
|
56
|
+
3. `:position` - extra fields starting position (from 0)
|
56
57
|
* `filter_for_main_fields klass`
|
57
58
|
* `form_for_main_fields klass`
|
58
59
|
|
@@ -3,11 +3,12 @@ module ActiveAdminSimpleLife
|
|
3
3
|
module SimpleElements
|
4
4
|
def index_for_main_fields(klass, options = {})
|
5
5
|
max_length = options[:max_length]
|
6
|
-
add_fields = [options[:add]].flatten.compact
|
6
|
+
add_fields = [options[:add]].flatten.compact
|
7
|
+
position = options[:position]
|
7
8
|
index download_links: false do
|
8
9
|
selectable_column
|
9
10
|
id_column
|
10
|
-
klass.main_fields.
|
11
|
+
klass.main_fields.insert(position, *add_fields).each do |symbol|
|
11
12
|
column(I18n.t("activerecord.attributes.#{klass.to_s.underscore}.#{symbol}"), sortable: symbol) do |current|
|
12
13
|
field_value = current.send(symbol.cut_id)
|
13
14
|
case field_value
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_admin_simple_life
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kvokka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|