rails 2.3rc1 application demonstrating an engine layout issue.
Ruby JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db
doc
log
public
script
test
vendor/plugins
README.md
Rakefile

README.md

It seems view layouts from engines where the controller is also present in the host app do not load in production, but load fine in development.

#Example# Github Repo

###working###

  1. ./script/server
  2. browse to http://localhost:3000/index

###not working###

  1. ./script/server -e production
  2. browse to http://localhost:3000/index

##Explanation## ###Host Application### app/controller/application_controller.rb app/views/layouts/ {empty} app/views/other_controller/index.html.haml @@@ haml %p content of app/view/other_controller/index.html.haml @@@

###Engine### vender/plugins/engine_name/app/controller/application_controller.rb vender/plugins/engine_name/app/controller/other_controller.rb @@@ ruby class OtherController < ApplicationController ... end @@@ vender/plugins/engine_name/app/views/layouts/application.html.haml @@@ ruby %h1 ApplicationController layouts content = yield @@@

###HTML output in production ### does not render the layouts @@@ ruby

content of app/view/other_controller/index.html.haml @@@

###HTML output in development ### renders the layouts @@@ ruby

ApplicationController layouts content

content of app/view/other_controller/index.html.haml @@@