This project is archived and is in readonly mode.
[Resolved]view templates from engines don't load in production
Reported by stefanpenner | February 28th, 2009 @ 08:32 PM | in 2.x
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
working
- ./script/server
- browse to http://localhost:3000/index
not working
- ./script/server -e production
- 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
%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
class OtherController < ApplicationController
...
end
vender/plugins/engine_name/app/views/layouts/application.html.haml
%h1 ApplicationController layouts content
= yield
HTML output in production
does not render the layouts
<p> content of app/view/other_controller/index.html.haml
HTML output in development
renders the layouts
<h1> ApplicationController layouts content</h1>
<p> content of app/view/other_controller/index.html.haml
Comments and changes to this ticket
-
thedarkone February 28th, 2009 @ 09:53 PM
I might be missing something, but why do you have
templates
dir instead oflayouts
? -
stefanpenner February 28th, 2009 @ 10:02 PM
thanks thedarkone: for pointing that out, that was my mistake in the ticket and has been corrected.
-
thedarkone February 28th, 2009 @ 10:44 PM
ok, thanks for clearing that up :), however I can't reproduce the issue, everything works in both dev and prod modes for me on edge rails.
I might be doing something wrong though... can you provide a complete small app (upload an archive or make project on github)?
-
stefanpenner February 28th, 2009 @ 11:30 PM
i've create a Github Repo, and added a link in the above description
-
thedarkone March 1st, 2009 @ 02:02 AM
I'm not sure I made myself clear ;), I can't confirm your issues with edge Rails. If I checkout out Rails v2.3.0 there's an error with unknown action in production env.
-
stefanpenner March 1st, 2009 @ 02:33 AM
- Title changed from view templates from engines don't load in production to [Resolved]view templates from engines don't load in production
seems doing another rake rails:freeze:edge fixes the issues, seems the code-base i was working with was outdated, my apologies.
-
josh March 2nd, 2009 @ 01:40 AM
- State changed from new to resolved
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>