Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[Resolved]view templates from engines don't load in production

#2103

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


%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

Reported by stefanpenner · February 28th, 2009 @ 08:32 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. thedarkone
    thedarkone

    I might be missing something, but why do you have templates dir instead of layouts?

    February 28th, 2009 @ 09:53 PM

  2. stefanpenner
    stefanpenner

    thanks thedarkone: for pointing that out, that was my mistake in the ticket and has been corrected.

    February 28th, 2009 @ 10:02 PM

  3. thedarkone
    thedarkone

    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)?

    February 28th, 2009 @ 10:44 PM

  4. stefanpenner
    stefanpenner

    i've create a Github Repo, and added a link in the above description

    February 28th, 2009 @ 11:30 PM

  5. thedarkone
    thedarkone

    Thanks, everything works fine with rails-edge for me.

    February 28th, 2009 @ 11:47 PM

  6. thedarkone
    thedarkone

    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.

    March 1st, 2009 @ 02:02 AM

  7. stefanpenner
    stefanpenner
    • 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.

    March 1st, 2009 @ 02:33 AM

  8. josh
    josh
    • State changed from new to resolved

    March 2nd, 2009 @ 01:40 AM