table-for 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/table-for.rb +0 -1
- data/lib/table_for/engine.rb +0 -1
- metadata +3 -4
- data/lib/table_for/helper_methods.rb +0 -22
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/lib/table-for.rb
CHANGED
data/lib/table_for/engine.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: table-for
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Hunter
|
@@ -104,7 +104,6 @@ files:
|
|
104
104
|
- VERSION
|
105
105
|
- lib/table-for.rb
|
106
106
|
- lib/table_for/engine.rb
|
107
|
-
- lib/table_for/helper_methods.rb
|
108
107
|
- lib/table_for/table_for.rb
|
109
108
|
- rails/init.rb
|
110
109
|
has_rdoc: true
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module TableFor
|
2
|
-
module HelperMethods
|
3
|
-
def table_for_options(options={}, parameters={})
|
4
|
-
evaluated_options = {}
|
5
|
-
options.each_pair { |k, v| evaluated_options[k] = (v.is_a?(Proc) ? v.call(parameters) : v)}
|
6
|
-
evaluated_options
|
7
|
-
end
|
8
|
-
|
9
|
-
def table_for(records, options={}, &block)
|
10
|
-
options[:view] = self
|
11
|
-
options[:records] = records
|
12
|
-
options[:block] = block
|
13
|
-
options[:row_html] = {:class => lambda { |parameters| cycle('odd', 'even')}} if options[:row_html].nil?
|
14
|
-
options[:template] = "table_for/table_for"
|
15
|
-
options[:templates_folder] = "table_for"
|
16
|
-
options[:record_variable] = "records"
|
17
|
-
options[:variable] = "table"
|
18
|
-
|
19
|
-
TableFor::Base.new(options).render
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|