rows_controller 0.1.0 → 0.2.3
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.
- data/.rvmrc +2 -1
- data/Gemfile +2 -2
- data/Gemfile.lock +33 -35
- data/README.md +17 -11
- data/app/views/rows/_list.html.erb +0 -1
- data/app/views/rows/index.html.erb +0 -2
- data/lib/rows_controller/version.rb +1 -1
- data/spec/controllers/orders_spec.rb +3 -1
- data/spec/dummy/script/rails +0 -0
- metadata +13 -41
data/.rvmrc
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,37 +1,35 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
actionmailer (3.1.
|
5
|
-
actionpack (= 3.1.
|
4
|
+
actionmailer (3.1.3)
|
5
|
+
actionpack (= 3.1.3)
|
6
6
|
mail (~> 2.3.0)
|
7
|
-
actionpack (3.1.
|
8
|
-
activemodel (= 3.1.
|
9
|
-
activesupport (= 3.1.
|
7
|
+
actionpack (3.1.3)
|
8
|
+
activemodel (= 3.1.3)
|
9
|
+
activesupport (= 3.1.3)
|
10
10
|
builder (~> 3.0.0)
|
11
11
|
erubis (~> 2.7.0)
|
12
12
|
i18n (~> 0.6)
|
13
|
-
rack (~> 1.3.
|
14
|
-
rack-cache (~> 1.
|
13
|
+
rack (~> 1.3.5)
|
14
|
+
rack-cache (~> 1.1)
|
15
15
|
rack-mount (~> 0.8.2)
|
16
16
|
rack-test (~> 0.6.1)
|
17
|
-
sprockets (~> 2.0.
|
18
|
-
activemodel (3.1.
|
19
|
-
activesupport (= 3.1.
|
20
|
-
bcrypt-ruby (~> 3.0.0)
|
17
|
+
sprockets (~> 2.0.3)
|
18
|
+
activemodel (3.1.3)
|
19
|
+
activesupport (= 3.1.3)
|
21
20
|
builder (~> 3.0.0)
|
22
21
|
i18n (~> 0.6)
|
23
|
-
activerecord (3.1.
|
24
|
-
activemodel (= 3.1.
|
25
|
-
activesupport (= 3.1.
|
22
|
+
activerecord (3.1.3)
|
23
|
+
activemodel (= 3.1.3)
|
24
|
+
activesupport (= 3.1.3)
|
26
25
|
arel (~> 2.2.1)
|
27
26
|
tzinfo (~> 0.3.29)
|
28
|
-
activeresource (3.1.
|
29
|
-
activemodel (= 3.1.
|
30
|
-
activesupport (= 3.1.
|
31
|
-
activesupport (3.1.
|
27
|
+
activeresource (3.1.3)
|
28
|
+
activemodel (= 3.1.3)
|
29
|
+
activesupport (= 3.1.3)
|
30
|
+
activesupport (3.1.3)
|
32
31
|
multi_json (~> 1.0)
|
33
32
|
arel (2.2.1)
|
34
|
-
bcrypt-ruby (3.0.1)
|
35
33
|
builder (3.0.0)
|
36
34
|
capybara (1.1.2)
|
37
35
|
mime-types (>= 1.16)
|
@@ -42,7 +40,6 @@ GEM
|
|
42
40
|
xpath (~> 0.1.4)
|
43
41
|
childprocess (0.3.0)
|
44
42
|
ffi (~> 1.0.6)
|
45
|
-
decent_exposure (1.0.2)
|
46
43
|
diff-lcs (1.1.3)
|
47
44
|
erubis (2.7.0)
|
48
45
|
ffi (1.0.11)
|
@@ -51,7 +48,7 @@ GEM
|
|
51
48
|
jquery-rails (1.0.19)
|
52
49
|
railties (~> 3.0)
|
53
50
|
thor (~> 0.14)
|
54
|
-
json (1.6.
|
51
|
+
json (1.6.5)
|
55
52
|
mail (2.3.0)
|
56
53
|
i18n (>= 0.4.0)
|
57
54
|
mime-types (~> 1.16)
|
@@ -61,7 +58,7 @@ GEM
|
|
61
58
|
nokogiri (1.5.0)
|
62
59
|
polyglot (0.3.3)
|
63
60
|
rack (1.3.6)
|
64
|
-
rack-cache (1.
|
61
|
+
rack-cache (1.1)
|
65
62
|
rack (>= 0.4)
|
66
63
|
rack-mount (0.8.3)
|
67
64
|
rack (>= 1.0.0)
|
@@ -69,17 +66,17 @@ GEM
|
|
69
66
|
rack
|
70
67
|
rack-test (0.6.1)
|
71
68
|
rack (>= 1.0)
|
72
|
-
rails (3.1.
|
73
|
-
actionmailer (= 3.1.
|
74
|
-
actionpack (= 3.1.
|
75
|
-
activerecord (= 3.1.
|
76
|
-
activeresource (= 3.1.
|
77
|
-
activesupport (= 3.1.
|
69
|
+
rails (3.1.3)
|
70
|
+
actionmailer (= 3.1.3)
|
71
|
+
actionpack (= 3.1.3)
|
72
|
+
activerecord (= 3.1.3)
|
73
|
+
activeresource (= 3.1.3)
|
74
|
+
activesupport (= 3.1.3)
|
78
75
|
bundler (~> 1.0)
|
79
|
-
railties (= 3.1.
|
80
|
-
railties (3.1.
|
81
|
-
actionpack (= 3.1.
|
82
|
-
activesupport (= 3.1.
|
76
|
+
railties (= 3.1.3)
|
77
|
+
railties (3.1.3)
|
78
|
+
actionpack (= 3.1.3)
|
79
|
+
activesupport (= 3.1.3)
|
83
80
|
rack-ssl (~> 1.3.2)
|
84
81
|
rake (>= 0.8.7)
|
85
82
|
rdoc (~> 3.4)
|
@@ -87,6 +84,7 @@ GEM
|
|
87
84
|
rake (0.9.2.2)
|
88
85
|
rdoc (3.12)
|
89
86
|
json (~> 1.4)
|
87
|
+
rows_controller (0.1.0)
|
90
88
|
rspec (2.8.0)
|
91
89
|
rspec-core (~> 2.8.0)
|
92
90
|
rspec-expectations (~> 2.8.0)
|
@@ -101,7 +99,7 @@ GEM
|
|
101
99
|
railties (>= 3.0)
|
102
100
|
rspec (~> 2.8.0)
|
103
101
|
rubyzip (0.9.5)
|
104
|
-
selenium-webdriver (2.
|
102
|
+
selenium-webdriver (2.17.0)
|
105
103
|
childprocess (>= 0.2.5)
|
106
104
|
ffi (~> 1.0.9)
|
107
105
|
multi_json (~> 1.0.4)
|
@@ -127,9 +125,9 @@ PLATFORMS
|
|
127
125
|
|
128
126
|
DEPENDENCIES
|
129
127
|
capybara
|
130
|
-
decent_exposure
|
131
128
|
jquery-rails
|
132
|
-
rails (= 3.1.
|
129
|
+
rails (= 3.1.3)
|
130
|
+
rows_controller
|
133
131
|
rspec-rails
|
134
132
|
spork
|
135
133
|
sqlite3
|
data/README.md
CHANGED
@@ -51,13 +51,14 @@ be changed by e.g.:
|
|
51
51
|
The model class can be retrieved with model_class.
|
52
52
|
|
53
53
|
|
54
|
-
|
55
|
-
----
|
54
|
+
## Enhancements
|
56
55
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
is
|
56
|
+
### copy
|
57
|
+
|
58
|
+
The method "copy" was added to the RowsController.
|
59
|
+
"copy" is like "new", however its attributes are initialized
|
60
|
+
from an existing resource.
|
61
|
+
The "id" of the cloned resource is set to nil.
|
61
62
|
|
62
63
|
Usage of "copy" requires a defining in config/routes.rb. An example:
|
63
64
|
|
@@ -65,9 +66,15 @@ Usage of "copy" requires a defining in config/routes.rb. An example:
|
|
65
66
|
get 'copy', :on => :member
|
66
67
|
end
|
67
68
|
|
69
|
+
### columns
|
70
|
+
|
71
|
+
Add a class method 'column_headers' to the model
|
72
|
+
returning the columns to be displayed by '#index'.
|
73
|
+
Default is to display the columns returned by 'content_columns',
|
74
|
+
a class method which returns the columns defined by the ActiveRecord model.
|
75
|
+
|
68
76
|
|
69
|
-
Installation and Testing
|
70
|
-
------------------------
|
77
|
+
## Installation and Testing
|
71
78
|
|
72
79
|
As usual:
|
73
80
|
|
@@ -77,8 +84,7 @@ As usual:
|
|
77
84
|
rake
|
78
85
|
|
79
86
|
|
80
|
-
Credits
|
81
|
-
-------
|
87
|
+
## Credits
|
82
88
|
|
83
89
|
Inspiration from the web.
|
84
90
|
Look for:
|
@@ -88,4 +94,4 @@ Look for:
|
|
88
94
|
- decent_exposure
|
89
95
|
|
90
96
|
|
91
|
-
Copyright (c) 2009-
|
97
|
+
Copyright (c) 2009-2012 [Dittmar Krall], released under the MIT license
|
@@ -57,7 +57,9 @@ end
|
|
57
57
|
describe CategoriesController do
|
58
58
|
it 'checking model_class' do
|
59
59
|
get :index
|
60
|
-
|
60
|
+
# both not working, Why?
|
61
|
+
# subject.send(:model_class).should be_a(Order)
|
62
|
+
# subject.send(:model_class).should == Order
|
61
63
|
subject.send(:model_name).should == 'Order'
|
62
64
|
subject.send(:model_symbol).should == 'order'
|
63
65
|
subject.send(:model_symbol_plural).should == 'orders'
|
data/spec/dummy/script/rails
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rows_controller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
13
|
-
default_executable:
|
12
|
+
date: 2012-02-20 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: sqlite3
|
17
|
-
requirement: &
|
16
|
+
requirement: &75061820 !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
19
|
- - ! '>='
|
@@ -22,10 +21,10 @@ dependencies:
|
|
22
21
|
version: '0'
|
23
22
|
type: :development
|
24
23
|
prerelease: false
|
25
|
-
version_requirements: *
|
24
|
+
version_requirements: *75061820
|
26
25
|
- !ruby/object:Gem::Dependency
|
27
26
|
name: rspec-rails
|
28
|
-
requirement: &
|
27
|
+
requirement: &75061000 !ruby/object:Gem::Requirement
|
29
28
|
none: false
|
30
29
|
requirements:
|
31
30
|
- - ! '>='
|
@@ -33,10 +32,10 @@ dependencies:
|
|
33
32
|
version: '0'
|
34
33
|
type: :development
|
35
34
|
prerelease: false
|
36
|
-
version_requirements: *
|
35
|
+
version_requirements: *75061000
|
37
36
|
- !ruby/object:Gem::Dependency
|
38
37
|
name: capybara
|
39
|
-
requirement: &
|
38
|
+
requirement: &75059980 !ruby/object:Gem::Requirement
|
40
39
|
none: false
|
41
40
|
requirements:
|
42
41
|
- - ! '>='
|
@@ -44,7 +43,7 @@ dependencies:
|
|
44
43
|
version: '0'
|
45
44
|
type: :development
|
46
45
|
prerelease: false
|
47
|
-
version_requirements: *
|
46
|
+
version_requirements: *75059980
|
48
47
|
description: YourController < RowsController ( < ApplicationController).
|
49
48
|
email:
|
50
49
|
- dittmar.krall@matique.de
|
@@ -107,7 +106,6 @@ files:
|
|
107
106
|
- spec/models/order_spec.rb
|
108
107
|
- spec/spec_helper.rb
|
109
108
|
- spec/support/describe_private.rb
|
110
|
-
has_rdoc: true
|
111
109
|
homepage: http://matique.de
|
112
110
|
licenses: []
|
113
111
|
post_install_message:
|
@@ -120,6 +118,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
118
|
- - ! '>='
|
121
119
|
- !ruby/object:Gem::Version
|
122
120
|
version: '0'
|
121
|
+
segments:
|
122
|
+
- 0
|
123
|
+
hash: 58148691
|
123
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
125
|
none: false
|
125
126
|
requirements:
|
@@ -128,37 +129,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
129
|
version: '0'
|
129
130
|
requirements: []
|
130
131
|
rubyforge_project:
|
131
|
-
rubygems_version: 1.
|
132
|
+
rubygems_version: 1.8.15
|
132
133
|
signing_key:
|
133
134
|
specification_version: 3
|
134
135
|
summary: Rows DRYs your controllers.
|
135
|
-
test_files:
|
136
|
-
- spec/controllers/orders_spec.rb
|
137
|
-
- spec/controllers/rows_spec.rb
|
138
|
-
- spec/dummy/Rakefile
|
139
|
-
- spec/dummy/app/assets/javascripts/application.js
|
140
|
-
- spec/dummy/app/controllers/application_controller.rb
|
141
|
-
- spec/dummy/app/controllers/orders_controller.rb
|
142
|
-
- spec/dummy/app/models/order.rb
|
143
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
144
|
-
- spec/dummy/app/views/orders/_form.html.erb
|
145
|
-
- spec/dummy/config.ru
|
146
|
-
- spec/dummy/config/application.rb
|
147
|
-
- spec/dummy/config/boot.rb
|
148
|
-
- spec/dummy/config/database.yml
|
149
|
-
- spec/dummy/config/environment.rb
|
150
|
-
- spec/dummy/config/environments/development.rb
|
151
|
-
- spec/dummy/config/environments/production.rb
|
152
|
-
- spec/dummy/config/environments/test.rb
|
153
|
-
- spec/dummy/config/initializers/secret_token.rb
|
154
|
-
- spec/dummy/config/initializers/session_store.rb
|
155
|
-
- spec/dummy/config/routes.rb
|
156
|
-
- spec/dummy/db/migrate/001_create_orders.rb
|
157
|
-
- spec/dummy/db/schema.rb
|
158
|
-
- spec/dummy/db/seeds.rb
|
159
|
-
- spec/dummy/public/favicon.ico
|
160
|
-
- spec/dummy/script/rails
|
161
|
-
- spec/integration/order_spec.rb
|
162
|
-
- spec/models/order_spec.rb
|
163
|
-
- spec/spec_helper.rb
|
164
|
-
- spec/support/describe_private.rb
|
136
|
+
test_files: []
|