views:

270

answers:

2

I'm stuck with a bug at the moment which is puzzling me. I have a layout containing some HTML and a partial (for the navigation) - there is nothing else there other than the yield.

  1. If the nav is included as a partial I get nothing returned to the browser at all (blank page) but everything else appears normal
  2. If I remove the partial the page works fine
  3. If I put the nav code directly in the template it works fine
  4. if I replace the nav code in the partial with a simple string, I get a blank page again.

Does anyone have any ideas as to what the problem could be, or know how I might debug it?

+1  A: 

Found the issue, the partial was in the layouts folder, instead of the relevant controller views folder.

However, Rails was throwing a ActionView::MissingTemplate Exception which was only visible via the debugger which is probably a bug.

Neil Middleton
Are you running in production mode? Stack trace errors don't show up in the view unless you're in development mode.
Sarah Mei
A: 

First off, check the log file to see if you're getting an error message somewhere. If that doesn't help follow these steps:

  • Make a copy of your template & partial, linked as the original
  • Test that they exhibit the problem
  • Start removing things from them until you have the simplest possible case that still exhibits the problem (your string in the partial test is a step in this direction)
  • If you don't figure it out in that process, come back and edit your question to include the code for the simplified case
MarkusQ