views:

21

answers:

1

For some reason the rendering of a view is failing on the production server, however has worked fine on the local dev and staging server.

In the app different accounts can have custom layouts and home page or use the default.

Snippet from production server (where it is failing)

Rendering template within layouts/accounts/default/layout
ActionView::MissingTemplate (Missing layout main/../layouts/accounts/default/home in view path app/views):

Snippet from local dev server (where it is working)

Rendering template within layouts/accounts/default/layout
Rendering main/../layouts/accounts/default/home

The folder structure is like so

app
|- views
|  `- main
|     `- some_other_main_templates
`- layouts
   `- accounts
      |- default
      |  |- layout
      |  `- home
      `- some_other_account

Here is a snippet of the code from within the index action of the MainController

layout_location = @account.use_custom_design? ? @account.subdomain : "default"
render :action => "../layouts/accounts/#{layout_location}/home", 
       :layout => "accounts/#{layout_location}/layout"

The files are checked in and on the server (As mentioned these problems were not seen on the staging server, so the source control isn't the issue).

Does anyone have any ideas?

FYI: I can split up the custom home and layout files into separate dirs, but I would like to keep them together to keep things organized.

A: 

Needed to use render :template => ...

chris