record_collection 0.4.1 → 0.4.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 +5 -2
- data/lib/record_collection/base.rb +1 -7
- data/lib/record_collection/name.rb +8 -0
- data/lib/record_collection/version.rb +1 -1
- data/spec/dummy/app/views/employees/collection_edit.html.slim +1 -1
- data/spec/dummy/app/views/employees/index.html.slim +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 629abcbda806a965d21f0c56102758f4dd155710
|
4
|
+
data.tar.gz: 52708e350c3ece73f4c847446ed4333da7552798
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ada1f8d479a7755526e369ed0eeb83a18f8b0aa30e16f40a2ae89abd22cba7af46b796279bcb4c19722e7dcaffe8a5aefdd845a602b22b7330fc9c42e9a7c0da
|
7
|
+
data.tar.gz: d51b151b2baf52a4b6849e3f1c4cbe75563ee047135e0bfc0452710106f1897079bc52f3bc537b1436ed6ba2bf5c035d378ba9235adfc3017579c1884f0adc0e
|
data/README.md
CHANGED
@@ -126,7 +126,7 @@ the standard [form_helpers](http://guides.rubyonrails.org/form_helpers.html)<br>
|
|
126
126
|
The form you create typically looks like [app/views/employees/collection_edit.html.slim](spec/dummy/app/views/employees/collection_edit.html.slim):
|
127
127
|
```slim
|
128
128
|
h1 Edit multiple employees
|
129
|
-
= form_for @collection, url: [:collection_update, @collection
|
129
|
+
= form_for @collection, url: [:collection_update, @collection] do |f|
|
130
130
|
= f.collection_ids
|
131
131
|
.form-inputs= f.optional_text_field :section
|
132
132
|
.form-inputs= f.optional_boolean :admin
|
@@ -147,8 +147,11 @@ standard way of selecting records from the index page. To filter records
|
|
147
147
|
to a specific subset the [ransack](https://github.com/activerecord-hackery/ransack)
|
148
148
|
gem also provides a nice way to add filtering to the index page. To add
|
149
149
|
checkbox selecting to your page this gem assumes the following
|
150
|
-
structure using the [Slim lang](http://slim-lang.com/)
|
150
|
+
structure using the [Slim lang](http://slim-lang.com/)
|
151
|
+
|
152
|
+
[app/views/employees/index.html.slim](spec/dummy/app/views/employees/index.html.slim)
|
151
153
|
```slim
|
154
|
+
h1 Listing Employees
|
152
155
|
table.with-selection
|
153
156
|
thead
|
154
157
|
tr
|
@@ -65,16 +65,10 @@ module RecordCollection
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def persisted?
|
68
|
-
# Behave like an update in forms
|
69
|
-
true
|
70
|
-
end
|
71
|
-
|
72
|
-
def new_record?
|
73
|
-
# Behave like an update in forms
|
68
|
+
# Behave like an update in forms, this triggers plural routes
|
74
69
|
false
|
75
70
|
end
|
76
71
|
|
77
|
-
|
78
72
|
# This method returns nil when the values of `attr` in the collection
|
79
73
|
# are mixed. Otherwise the value itself. For boolean attributes the
|
80
74
|
# check is wether the values are truthy or falsy. If the
|
@@ -1,5 +1,5 @@
|
|
1
1
|
h1 Edit multiple employees
|
2
|
-
= form_for @collection, url: [:collection_update, @collection
|
2
|
+
= form_for @collection, url: [:collection_update, @collection] do |f|
|
3
3
|
= render 'form_errors', target: @collection
|
4
4
|
.form-inputs= f.optional_text_field :section
|
5
5
|
.form-inputs= f.optional_boolean :admin
|