mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user