grapple 0.1.1 → 0.1.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/lib/grapple/helpers/table_helper.rb +10 -3
- 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: 46d51d0d775864d1d0786ad077c385bee0fdc0f4
|
4
|
+
data.tar.gz: a023e77771a81ad8d24e3ddcc8c531113b8ff37a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa8c2a04a826b5b169bc35555a4a81c46022096b1310b58285b308db8161ce59e29c1450698438782c1e3498b5de517e7962e851f40effcf2d98031b1600b574
|
7
|
+
data.tar.gz: a3344fa9aa22a8d5b0171e54e3ec67c7c6b5725c22c4fc362d931d5d2d31718ac234b182efe9cd638c0953ed606d569ed5b07ae7687b02026958b8e45a8e0b4b
|
@@ -7,12 +7,11 @@ module Grapple
|
|
7
7
|
|
8
8
|
def table_for(columns, records, *args, &block)
|
9
9
|
options = args[0] || {}
|
10
|
+
# Don't render the container for AJAX requests by default
|
10
11
|
render_container = (options[:container].nil? ? !request.xhr? : options[:container]) rescue false
|
11
12
|
table_html_attributes = options[:html] || {}
|
12
13
|
options[:builder] = options[:builder] || @@builder
|
13
|
-
|
14
|
-
# HACK: "defined? params" is returning method but when it gets called the method is not defined
|
15
|
-
request_params = request.params() rescue {}
|
14
|
+
request_params = options[:params] ? options[:params] : grapple_request_params
|
16
15
|
builder = options[:builder].new(self, columns, records, request_params, options)
|
17
16
|
output = capture(builder, &block)
|
18
17
|
table_html = (builder.before_table + builder.table(output, table_html_attributes) + builder.after_table)
|
@@ -22,6 +21,14 @@ module Grapple
|
|
22
21
|
table_html.html_safe
|
23
22
|
end
|
24
23
|
end
|
24
|
+
|
25
|
+
def grapple_request_params
|
26
|
+
# params might not be defined (being called from a mailer)
|
27
|
+
# HACK: "defined? params" is returning method but when it gets called the method is not defined
|
28
|
+
params()
|
29
|
+
rescue
|
30
|
+
request.params() rescue {}
|
31
|
+
end
|
25
32
|
|
26
33
|
def grapple_container(*args, &block)
|
27
34
|
options = args[0] || {}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grapple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edward Potocko
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-08-
|
13
|
+
date: 2016-08-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: actionpack
|