This project is archived and is in readonly mode.

#2103 ✓resolved
stefanpenner

[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

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

Comments and changes to this ticket

  • thedarkone

    thedarkone February 28th, 2009 @ 09:53 PM

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

  • stefanpenner

    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

    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

    stefanpenner February 28th, 2009 @ 11:30 PM

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

  • thedarkone

    thedarkone February 28th, 2009 @ 11:47 PM

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

  • thedarkone

    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

    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

    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>

People watching this ticket

Pages