Permalink
Browse files

A bug inherited from scaffold generator: when a module is specified (…

…e.g., Admin::People), the layout file gets created in app/views/layouts instead of in a subdirectory (e.g., app/views/layouts/admin). At runtime Rails renders all those views without a layout
  • Loading branch information...
1 parent fd04c23 commit c58f19a627abdb333f310fd1d548ba4949f0c589 @njonsson committed Jun 26, 2006
Showing with 6 additions and 3 deletions.
  1. +1 −1 trestle_generator.gemspec
  2. +5 −2 trestle_generator.rb
View
2 trestle_generator.gemspec
@@ -2,7 +2,7 @@ require 'rubygems'
spec = Gem::Specification.new do |s|
s.name = 'trestle_generator'
- s.version = '1.1.5'
+ s.version = '1.1.6'
s.summary = '[Rails] A drop-in replacement for the scaffold generator that ' +
'produces production-ready controllers that are safe from ' +
'state-changing HTTP GET requests and that have streamlined URLs.'
View
7 trestle_generator.rb
@@ -114,8 +114,11 @@ def manifest
"#{controller_file_name}_helper.rb")
# Layout and stylesheet.
- m.template 'layout.rhtml', "app/views/layouts/#{controller_file_name}.rhtml"
- m.template 'style.css', 'public/stylesheets/trestle.css'
+ m.template 'layout.rhtml',
+ File.join('app/views/layouts',
+ controller_class_path,
+ "#{controller_file_name}.rhtml")
+ m.template 'style.css', 'public/stylesheets/trestle.css'
# Non-trestle views.

0 comments on commit c58f19a

Please sign in to comment.