corn_starch 1.3.42 → 1.4.0
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/app/controllers/corn_starch/corn_starch_controller.rb +19 -0
- data/lib/corn_starch/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: e0074ed6b3f5853a491e6bd914f6bab39567357e
|
|
4
|
+
data.tar.gz: da34a099432775f977c870e593c2b459bacd077c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a8b53cb70675670a5e21627afad51829e2e36c10752873afb4fb5987061df754e4f070082674d07b948e8cf856f42710d0ee499dd1c2997a02cd8a0bd05bc4a5
|
|
7
|
+
data.tar.gz: 557a7ff95e16d40842a4181b39461acfc795bac1bee9f7f0ebdb24a96e1315b88c1a923c2e3d503450f1072c109dc93a13385b34beebba620df35c598cf568f8
|
|
@@ -212,6 +212,25 @@ module CornStarch
|
|
|
212
212
|
collection.limit(@pagination[:recs_per_page]).offset current * @pagination[:recs_per_page]
|
|
213
213
|
end
|
|
214
214
|
|
|
215
|
+
# Redirect to Result
|
|
216
|
+
def redirect_to_result model, entity, action, res
|
|
217
|
+
|
|
218
|
+
# Compute Result Status and Key
|
|
219
|
+
key, status = res ? [:notice, :pass] : [:alert, :fail]
|
|
220
|
+
|
|
221
|
+
# Acquire Singular Model Name
|
|
222
|
+
model_name = model.model_name.singular
|
|
223
|
+
|
|
224
|
+
# Generate URL Method
|
|
225
|
+
url_meth = { create: ["new_#{model_name}_url".to_sym], update: ["edit_#{model_name}_url".to_sym, entity] }[action]
|
|
226
|
+
|
|
227
|
+
# Generate URL
|
|
228
|
+
url = send *url_meth
|
|
229
|
+
|
|
230
|
+
# Redirect
|
|
231
|
+
redirect_to (res ? entity : url), key => notice_msg(model, entity, action, status)
|
|
232
|
+
end
|
|
233
|
+
|
|
215
234
|
# Generic Notice Messages
|
|
216
235
|
def notice_msg model, entity, action, result_or_name
|
|
217
236
|
|
data/lib/corn_starch/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: corn_starch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eresse
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-06-
|
|
11
|
+
date: 2016-06-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|