1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Resource and scaffold generators pass on the full name to the dependent model, so nested resources give a corresponding nested model.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2007-11-16 22:56:40 +00:00
parent 473202df83
commit ace7518fcb
2 changed files with 2 additions and 2 deletions

View file

@ -41,7 +41,7 @@ class ResourceGenerator < Rails::Generator::NamedBase
m.directory(File.join('test/functional', controller_class_path))
m.directory(File.join('test/unit', class_path))
m.dependency 'model', [singular_name] + @args, :collision => :skip
m.dependency 'model', [name] + @args, :collision => :skip
m.template(
'controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")

View file

@ -54,7 +54,7 @@ class ScaffoldGenerator < Rails::Generator::NamedBase
m.template('layout.html.erb', File.join('app/views/layouts', controller_class_path, "#{controller_file_name}.html.erb"))
m.template('style.css', 'public/stylesheets/scaffold.css')
m.dependency 'model', [singular_name] + @args, :collision => :skip
m.dependency 'model', [name] + @args, :collision => :skip
m.template(
'controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")