active_leonardo 0.1.0 → 0.2.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.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +44 -0
  3. data/LICENSE +19 -19
  4. data/README.md +173 -0
  5. data/active_template.rb +141 -137
  6. data/lib/generators/active_leonardo.rb +7 -1
  7. data/lib/generators/erb/leosca/leosca_generator.rb +122 -122
  8. data/lib/generators/leolay/USAGE +21 -21
  9. data/lib/generators/leolay/leolay_generator.rb +420 -400
  10. data/lib/generators/leolay/templates/app/admin/users.rb +87 -87
  11. data/lib/generators/leolay/templates/config/locales/it.yml +7 -0
  12. data/lib/generators/leolay/templates/spec/helpers/application_helpers.rb +13 -13
  13. data/lib/generators/leolay/templates/spec/support/devise.rb +4 -4
  14. data/lib/generators/leolay/templates/styles/active/stylesheets/app/custom_active_admin.css.scss +27 -27
  15. data/lib/generators/leosca/USAGE +23 -23
  16. data/lib/generators/rails/leosca/USAGE +39 -39
  17. data/lib/generators/rails/leosca/leosca_generator.rb +55 -55
  18. data/lib/generators/rails/leosca/templates/leosca.css +56 -56
  19. data/lib/generators/rails/leosca_controller/USAGE +23 -23
  20. data/lib/generators/rails/leosca_controller/leosca_controller_generator.rb +192 -188
  21. data/lib/generators/rails/leosca_controller/templates/controller.rb +3 -3
  22. data/lib/generators/rspec/leointegration/leointegration_generator.rb +35 -35
  23. data/lib/generators/rspec/leointegration/templates/admin/feature.rb +67 -67
  24. data/lib/generators/rspec/leointegration/templates/feature.rb +9 -9
  25. data/lib/generators/rspec/leosca/leosca_generator.rb +57 -57
  26. data/lib/generators/rspec/leosca/templates/admin/controller_spec.rb +181 -181
  27. data/lib/generators/rspec/leosca/templates/admin/edit_spec.rb +31 -31
  28. data/lib/generators/rspec/leosca/templates/admin/index_spec.rb +32 -32
  29. data/lib/generators/rspec/leosca/templates/admin/new_spec.rb +30 -30
  30. data/lib/generators/rspec/leosca/templates/admin/routing_spec.rb +39 -39
  31. data/lib/generators/rspec/leosca/templates/admin/show_spec.rb +28 -28
  32. data/lib/generators/rspec/leosca/templates/controller_spec.rb +168 -168
  33. data/lib/generators/rspec/leosca/templates/edit_spec.rb +31 -31
  34. data/lib/generators/rspec/leosca/templates/index_spec.rb +32 -32
  35. data/lib/generators/rspec/leosca/templates/new_spec.rb +30 -30
  36. data/lib/generators/rspec/leosca/templates/routing_spec.rb +39 -39
  37. data/lib/generators/rspec/leosca/templates/show_spec.rb +28 -28
  38. metadata +55 -124
  39. data/CHANGELOG +0 -28
  40. data/README.rdoc +0 -159
@@ -1,56 +1,56 @@
1
- body { background-color: #fff; color: #333; }
2
-
3
- body, p, ol, ul, td {
4
- font-family: verdana, arial, helvetica, sans-serif;
5
- font-size: 13px;
6
- line-height: 18px;
7
- }
8
-
9
- pre {
10
- background-color: #eee;
11
- padding: 10px;
12
- font-size: 11px;
13
- }
14
-
15
- a { color: #000; }
16
- a:visited { color: #666; }
17
- a:hover { color: #fff; background-color:#000; }
18
-
19
- div.field, div.actions {
20
- margin-bottom: 10px;
21
- }
22
-
23
- #notice {
24
- color: green;
25
- }
26
-
27
- .field_with_errors {
28
- padding: 2px;
29
- background-color: red;
30
- display: table;
31
- }
32
-
33
- #error_explanation {
34
- width: 450px;
35
- border: 2px solid red;
36
- padding: 7px;
37
- padding-bottom: 0;
38
- margin-bottom: 20px;
39
- background-color: #f0f0f0;
40
- }
41
-
42
- #error_explanation h2 {
43
- text-align: left;
44
- font-weight: bold;
45
- padding: 5px 5px 5px 15px;
46
- font-size: 12px;
47
- margin: -7px;
48
- margin-bottom: 0px;
49
- background-color: #c00;
50
- color: #fff;
51
- }
52
-
53
- #error_explanation ul li {
54
- font-size: 12px;
55
- list-style: square;
56
- }
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -1,23 +1,23 @@
1
- Description:
2
- en: Customized version of rails's scaffold_controller, to be used after leolay.
3
- it: Versione personalizzata dello scaffold_controller di rails, da usare dopo leolay.
4
-
5
- Stubs out a scaffolded controller and its views. Pass the model name,
6
- either CamelCased or under_scored, and a list of views as arguments.
7
- The controller name is retrieved as a pluralized version of the model
8
- name.
9
-
10
- To create a controller within a module, specify the model name as a
11
- path like 'parent_module/controller_name'.
12
-
13
- This generates a controller class in app/controllers and invokes helper,
14
- template engine and test framework generators.
15
-
16
- Example:
17
- `rails generate leosca_controller CreditCard`
18
-
19
- Credit card controller with URLs like /credit_card/debit.
20
- Controller: app/controllers/credit_cards_controller.rb
21
- Functional Test: test/functional/credit_cards_controller_test.rb
22
- Views: app/views/credit_cards/index.html.erb [...]
23
- Helper: app/helpers/credit_cards_helper.rb
1
+ Description:
2
+ en: Customized version of rails's scaffold_controller, to be used after leolay.
3
+ it: Versione personalizzata dello scaffold_controller di rails, da usare dopo leolay.
4
+
5
+ Stubs out a scaffolded controller and its views. Pass the model name,
6
+ either CamelCased or under_scored, and a list of views as arguments.
7
+ The controller name is retrieved as a pluralized version of the model
8
+ name.
9
+
10
+ To create a controller within a module, specify the model name as a
11
+ path like 'parent_module/controller_name'.
12
+
13
+ This generates a controller class in app/controllers and invokes helper,
14
+ template engine and test framework generators.
15
+
16
+ Example:
17
+ `rails generate leosca_controller CreditCard`
18
+
19
+ Credit card controller with URLs like /credit_card/debit.
20
+ Controller: app/controllers/credit_cards_controller.rb
21
+ Functional Test: test/functional/credit_cards_controller_test.rb
22
+ Views: app/views/credit_cards/index.html.erb [...]
23
+ Helper: app/helpers/credit_cards_helper.rb
@@ -1,188 +1,192 @@
1
- require 'rails/generators/rails/scaffold_controller/scaffold_controller_generator'
2
- require File.join(File.dirname(__FILE__), '../../active_leonardo')
3
-
4
- WINDOWS = (RUBY_PLATFORM =~ /dos|win32|cygwin/i) || (RUBY_PLATFORM =~ /(:?mswin|mingw)/)
5
- CRLF = WINDOWS ? "\r\n" : "\n"
6
-
7
- module Rails
8
- module Generators
9
- class LeoscaControllerGenerator < ::Rails::Generators::ScaffoldControllerGenerator
10
- include ::ActiveLeonardo::Base
11
- include ::ActiveLeonardo::Leosca
12
- #include ::Leonardo::Nested
13
- #include ::Leonardo::Nested::Test
14
- #puts 'rails:leosca_controller'
15
-
16
- source_root File.expand_path('../templates', __FILE__)
17
- argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
18
- class_option :seeds, :type => :boolean, :default => true, :desc => "Create seeds to run with rake db:seed"
19
- class_option :seeds_elements, :type => :string, :default => "30", :desc => "Choose seeds elements", :banner => "NUMBER"
20
- #class_option :remote, :type => :boolean, :default => true, :desc => "Enable ajax. You can also do later set remote to true into index view."
21
- #class_option :under, :type => :string, :default => "", :banner => "brand/category", :desc => "To nest a resource under another(s)"
22
- #class_option :leospace, :type => :string, :default => "", :banner => ":admin", :desc => "To nest a resource under namespace(s)"
23
- class_option :auth_class, :type => :string, :default => 'User', :desc => "Set the authentication class name"
24
- class_option :activeadmin, :type => :boolean, :default => true, :desc => "Add code to manage activeadmin gem"
25
-
26
- #Override
27
- def create_controller_files
28
- template 'controller.rb', File.join('app/controllers', class_path, "#{controller_file_name}_controller.rb")
29
- end
30
-
31
- #Override
32
- #hook_for :template_engine, :test_framework, :as => :leosca
33
- hook_for :test_framework, :as => :leosca
34
-
35
- def update_yaml_locales
36
- #Inject model and attributes name into yaml files for i18n
37
- path = "config/locales"
38
- files = []
39
- files = Dir["#{path}/??.yml"]
40
- files.each do |file|
41
-
42
- next unless File.exists?(file)
43
-
44
- #Fields name
45
- inject_into_file file, :after => "#Attributes zone - do not remove#{CRLF}" do
46
- content = " #{file_name}:#{CRLF}"
47
- attributes.each do |attribute|
48
- content << " #{attribute.name}: \"#{attribute.name.humanize}\"#{CRLF}"
49
- end
50
- #content << " op_new: \"New #{singular_table_name}\"#{CRLF}"
51
- #content << " op_edit: \"Editing #{singular_table_name}\"#{CRLF}"
52
- #content << " op_edit_multiple: \"Editing #{plural_table_name}\"#{CRLF}"
53
- #content << " op_copy: \"Creating new #{plural_table_name}\"#{CRLF}"
54
- #content << " op_index: \"Listing #{plural_table_name}\"#{CRLF}"
55
- content
56
- end
57
-
58
- #Model name
59
- inject_into_file file, :after => "models: &models#{CRLF}" do
60
- <<-FILE.gsub(/^ /, '')
61
- #{file_name}: "#{file_name.capitalize}"
62
- #{controller_name}: "#{controller_name.capitalize}"
63
- FILE
64
- end
65
-
66
- #Formtastic
67
- inject_into_file file, :after => " hints:#{CRLF}" do
68
- content = " #{file_name}:#{CRLF}"
69
- attributes.each do |attribute|
70
- attr_name = attribute.name.humanize
71
- case attribute.type
72
- when :integer, :decimal, :float
73
- content << " #{attribute.name}: \"Fill the #{attr_name} with a#{"n" if attribute.type == :integer} #{attribute.type.to_s} number\"#{CRLF}"
74
- when :boolean
75
- content << " #{attribute.name}: \"Select if this #{file_name} should be #{attr_name} or not\"#{CRLF}"
76
- when :string, :text
77
- content << " #{attribute.name}: \"Choose a good #{attr_name} for this #{file_name}\"#{CRLF}"
78
- when :date, :datetime, :time, :timestamp
79
- content << " #{attribute.name}: \"Choose a #{attribute.type.to_s} for #{attr_name}\"#{CRLF}"
80
- else
81
- content << " #{attribute.name}: \"Choose a #{attr_name}\"#{CRLF}"
82
- end
83
- end
84
- content
85
- end
86
-
87
- end
88
- end
89
-
90
- def update_ability_model
91
- return unless authorization?
92
- inject_into_file authorization_file, :before => " end\nend" do
93
- <<-FILE.gsub(/^ /, '')
94
- #can :read, #{class_name} if #{options[:auth_class].downcase}.new_record? #Guest
95
- can :read, #{class_name} if #{options[:auth_class].downcase}.role? :guest #Registered guest
96
- if #{options[:auth_class].downcase}.role? :user
97
- can [:read, :create], #{class_name}
98
- can [:update, :destroy], #{class_name} do |#{singular_table_name}|
99
- if defined?(#{singular_table_name}.#{options[:auth_class].downcase}_id)
100
- #{singular_table_name}.#{options[:auth_class].downcase}_id == #{options[:auth_class].downcase}.id
101
- else
102
- true
103
- end
104
- end
105
- end
106
- if #{options[:auth_class].downcase}.role? :manager
107
- can [:read, :create, :update, :destroy], #{class_name}
108
- end
109
-
110
- FILE
111
- end
112
- end
113
-
114
- def add_seeds_db
115
- return unless options.seeds? and options[:seeds_elements].to_i > 0
116
- file = "db/seeds.rb"
117
- append_file file do
118
- items = []
119
- attributes.each do |attribute|
120
- items << attribute_to_hash(attribute)
121
- end
122
- row = "{ #{items.join(', ')} }"
123
-
124
- #TODO: to have different values for every row
125
- content = "#{CRLF}### Created by leosca controller generator ### #{CRLF}#{class_name}.create([#{CRLF}"
126
- options[:seeds_elements].to_i.times do |n|
127
- content << "#{row.gsub(/\#/, (n+1).to_s)},#{CRLF}"
128
- end
129
- content << "])#{CRLF}"
130
- content
131
- end if File.exists?(file)
132
- end
133
-
134
- def invoke_active_admin
135
- return unless activeadmin? and options[:activeadmin]
136
- #Rails::Generators.invoke("active_admin:resource", [singular_table_name])
137
- invoke "active_admin:resource", [singular_table_name]
138
- file = "app/admin/#{plural_table_name}.rb"
139
-
140
- inject_into_file file, :after => "ActiveAdmin.register #{class_name} do" do
141
- <<-FILE.gsub(/^ /, '')
142
-
143
- menu :if => proc{ can?(:read, #{class_name}) }
144
-
145
- controller do
146
- load_resource :except => :index
147
- authorize_resource
148
- end
149
- FILE
150
- end if authorization? && File.exists?(file)
151
- end
152
-
153
- def update_specs
154
- file = "spec/spec_helper.rb"
155
- return unless File.exists? file
156
-
157
- file = "spec/factories.rb"
158
- inject_into_file file, :before => " ### Insert below here other your factories ###" do
159
- items = []
160
- attributes.each do |attribute|
161
- items << attribute_to_factories(attribute)
162
- end
163
- <<-FILE.gsub(/^ /, '')
164
-
165
- factory :#{singular_table_name} do |#{singular_table_name[0..0]}|
166
- #{items.join(CRLF)}
167
- end
168
- FILE
169
- end if File.exists?(file)
170
- end
171
-
172
- #def update_parent_controller
173
- # return unless nested?
174
- # file = "app/controllers/#{plural_last_parent}_controller.rb"
175
- # inject_into_file file, :before => " private" do
176
- # <<-FILE.gsub(/^ /, '')
177
- # def with_#{plural_table_name}
178
- # @#{last_parent} = #{last_parent.classify}.find params[:#{last_parent}_id]
179
- # @#{plural_table_name} = #{class_name}.where(:#{last_parent}_id => params[:#{last_parent}_id])
180
- # end
181
- #
182
- # FILE
183
- # end if File.exists?(file)
184
- #end
185
-
186
- end
187
- end
188
- end
1
+ require 'rails/generators/rails/scaffold_controller/scaffold_controller_generator'
2
+ require File.join(File.dirname(__FILE__), '../../active_leonardo')
3
+
4
+ WINDOWS = (RUBY_PLATFORM =~ /dos|win32|cygwin/i) || (RUBY_PLATFORM =~ /(:?mswin|mingw)/)
5
+ CRLF = WINDOWS ? "\r\n" : "\n"
6
+
7
+ module Rails
8
+ module Generators
9
+ class LeoscaControllerGenerator < ::Rails::Generators::ScaffoldControllerGenerator
10
+ include ::ActiveLeonardo::Base
11
+ include ::ActiveLeonardo::Leosca
12
+ #include ::Leonardo::Nested
13
+ #include ::Leonardo::Nested::Test
14
+ #puts 'rails:leosca_controller'
15
+
16
+ source_root File.expand_path('../templates', __FILE__)
17
+ argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
18
+ class_option :seeds, :type => :boolean, :default => true, :desc => "Create seeds to run with rake db:seed"
19
+ class_option :seeds_elements, :type => :string, :default => "30", :desc => "Choose seeds elements", :banner => "NUMBER"
20
+ #class_option :remote, :type => :boolean, :default => true, :desc => "Enable ajax. You can also do later set remote to true into index view."
21
+ #class_option :under, :type => :string, :default => "", :banner => "brand/category", :desc => "To nest a resource under another(s)"
22
+ #class_option :leospace, :type => :string, :default => "", :banner => ":admin", :desc => "To nest a resource under namespace(s)"
23
+ class_option :auth_class, :type => :string, :default => 'User', :desc => "Set the authentication class name"
24
+ class_option :activeadmin, :type => :boolean, :default => true, :desc => "Add code to manage activeadmin gem"
25
+
26
+ #Override
27
+ def create_controller_files
28
+ template 'controller.rb', File.join('app/controllers', class_path, "#{controller_file_name}_controller.rb")
29
+ end
30
+
31
+ #Override
32
+ #hook_for :template_engine, :test_framework, :as => :leosca
33
+
34
+ def update_yaml_locales
35
+ #Inject model and attributes name into yaml files for i18n
36
+ path = "config/locales"
37
+ files = Dir["#{path}/??.yml"]
38
+ files.each do |file|
39
+
40
+ next unless File.exists?(file)
41
+
42
+ #Fields name
43
+ inject_into_file file, :after => "#Attributes zone - do not remove" do
44
+ content = "#{CRLF} #{file_name}:#{CRLF}"
45
+ attributes.each do |attribute|
46
+ content << " #{attribute.name}: \"#{attribute.name.humanize}\"#{CRLF}"
47
+ end
48
+ #content << " op_new: \"New #{singular_table_name}\"#{CRLF}"
49
+ #content << " op_edit: \"Editing #{singular_table_name}\"#{CRLF}"
50
+ #content << " op_edit_multiple: \"Editing #{plural_table_name}\"#{CRLF}"
51
+ #content << " op_copy: \"Creating new #{plural_table_name}\"#{CRLF}"
52
+ #content << " op_index: \"Listing #{plural_table_name}\"#{CRLF}"
53
+ content
54
+ end
55
+
56
+ #Model name
57
+ inject_into_file file, :after => "models: &models" do
58
+ <<-FILE.gsub(/^ /, '')
59
+
60
+ #{file_name}: "#{file_name.capitalize}"
61
+ #{controller_name}: "#{controller_name.capitalize}"
62
+ FILE
63
+ end
64
+
65
+ #Formtastic
66
+ inject_into_file file, :after => " hints:" do
67
+ content = "#{CRLF} #{file_name}:#{CRLF}"
68
+ attributes.each do |attribute|
69
+ attr_name = attribute.name.humanize
70
+ case attribute.type
71
+ when :integer, :decimal, :float
72
+ content << " #{attribute.name}: \"Fill the #{attr_name} with a#{"n" if attribute.type == :integer} #{attribute.type.to_s} number\"#{CRLF}"
73
+ when :boolean
74
+ content << " #{attribute.name}: \"Select if this #{file_name} should be #{attr_name} or not\"#{CRLF}"
75
+ when :string, :text
76
+ content << " #{attribute.name}: \"Choose a good #{attr_name} for this #{file_name}\"#{CRLF}"
77
+ when :date, :datetime, :time, :timestamp
78
+ content << " #{attribute.name}: \"Choose a #{attribute.type.to_s} for #{attr_name}\"#{CRLF}"
79
+ else
80
+ content << " #{attribute.name}: \"Choose a #{attr_name}\"#{CRLF}"
81
+ end
82
+ end
83
+ content
84
+ end
85
+
86
+ end
87
+ end
88
+
89
+ def update_ability_model
90
+ return unless authorization?
91
+ inject_into_file authorization_file, :before => " end\nend" do
92
+ <<-FILE.gsub(/^ /, '')
93
+
94
+ # ----- #{class_name.upcase} ----- #
95
+ can :read, #{class_name} if #{options[:auth_class].downcase}.role? :guest
96
+ if #{options[:auth_class].downcase}.role? :user
97
+ can [:read, :create], #{class_name}
98
+ can [:update, :destroy], #{class_name}
99
+ end
100
+ if #{options[:auth_class].downcase}.role? :manager
101
+ can [:read, :create, :update, :destroy], #{class_name}
102
+ end
103
+
104
+ FILE
105
+ end
106
+ end
107
+
108
+ def add_seeds_db
109
+ return unless options.seeds? and options[:seeds_elements].to_i > 0
110
+ file = "db/seeds.rb"
111
+ append_file file do
112
+ items = []
113
+ attributes.each do |attribute|
114
+ items << attribute_to_hash(attribute)
115
+ end
116
+ row = "{ #{items.join(', ')} }"
117
+
118
+ #TODO: to have different values for every row
119
+ content = "#{CRLF}### Created by leosca controller generator ### #{CRLF}"
120
+ attributes.each do |attribute|
121
+ content << attribute_to_range(attribute)
122
+ end
123
+ content << "#{class_name}.create([#{CRLF}"
124
+ options[:seeds_elements].to_i.times do |n|
125
+ content << "#{row.gsub(/\#/, (n+1).to_s)},#{CRLF}"
126
+ end
127
+ content << "])#{CRLF}"
128
+ content
129
+ end if File.exists?(file)
130
+ end
131
+
132
+ def invoke_active_admin
133
+ return unless activeadmin? and options[:activeadmin]
134
+ #Rails::Generators.invoke("active_admin:resource", [singular_table_name])
135
+ invoke "active_admin:resource", [singular_table_name]
136
+ file = "app/admin/#{singular_table_name}.rb"
137
+
138
+ inject_into_file file, :after => "ActiveAdmin.register #{class_name} do" do
139
+ <<-FILE.gsub(/^ /, '')
140
+
141
+ menu :if => proc{ can?(:read, #{class_name}) }
142
+
143
+ permit_params do
144
+ permitted = [#{attributes.map{|attr| ":#{attr.name}"}.join(', ')}]
145
+ permitted
146
+ end
147
+
148
+ controller do
149
+ load_resource :except => :index
150
+ end
151
+
152
+
153
+ FILE
154
+ end if authorization? && File.exists?(file)
155
+ end
156
+
157
+ def update_specs
158
+ file = "spec/spec_helper.rb"
159
+ return unless File.exists? file
160
+
161
+ file = "spec/factories.rb"
162
+ inject_into_file file, :before => " ### Insert below here other your factories ###" do
163
+ items = []
164
+ attributes.each do |attribute|
165
+ items << attribute_to_factories(attribute)
166
+ end
167
+ <<-FILE.gsub(/^ /, '')
168
+
169
+ factory :#{singular_table_name} do |#{singular_table_name[0..0]}|
170
+ #{items.join(CRLF)}
171
+ end
172
+ FILE
173
+ end if File.exists?(file)
174
+ end
175
+
176
+ #def update_parent_controller
177
+ # return unless nested?
178
+ # file = "app/controllers/#{plural_last_parent}_controller.rb"
179
+ # inject_into_file file, :before => " private" do
180
+ # <<-FILE.gsub(/^ /, '')
181
+ # def with_#{plural_table_name}
182
+ # @#{last_parent} = #{last_parent.classify}.find params[:#{last_parent}_id]
183
+ # @#{plural_table_name} = #{class_name}.where(:#{last_parent}_id => params[:#{last_parent}_id])
184
+ # end
185
+ #
186
+ # FILE
187
+ # end if File.exists?(file)
188
+ #end
189
+
190
+ end
191
+ end
192
+ end