Show correct paths to generated templates for nexted controllers. Fixes #730

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1828 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Nicholas Seckar
2005-07-14 01:12:21 +00:00
parent fe0c7f4f76
commit 19ee13867e
3 changed files with 10 additions and 9 deletions

View File

@@ -28,9 +28,10 @@ class ControllerGenerator < Rails::Generator::NamedBase
# View template for each action.
actions.each do |action|
path = File.join('app/views', class_path, file_name, "#{action}.rhtml")
m.template 'view.rhtml',
File.join('app/views', class_path, file_name, "#{action}.rhtml"),
:assigns => { :action => action }
path,
:assigns => { :action => action, :path => path }
end
end
end

View File

@@ -1,2 +1,2 @@
<h1><%= class_name %>#<%= action %></h1>
<p>Find me in app/views/<%= file_name %>/<%= action %>.rhtml</p>
<p>Find me in <%= path %></p>

View File

@@ -115,12 +115,12 @@ class ScaffoldGenerator < Rails::Generator::NamedBase
# Unscaffolded views.
unscaffolded_actions.each do |action|
m.template "controller:view.rhtml",
File.join('app/views',
controller_class_path,
controller_file_name,
"#{action}.rhtml"),
:assigns => { :action => action }
path = File.join('app/views',
controller_class_path,
controller_file_name,
"#{action}.rhtml")
m.template "controller:view.rhtml", path,
:assigns => { :action => action, :path => path}
end
end
end