Search code examples
rubyhamlramaze

Ramaze's Haml engine returns same template every time


I've run into a problem with my very simple Ramaze project. My project is identical to the prototype project that is generated from 'ramaze create mywebsite', except that I'm using Haml templates (I set 'engine :Haml' in controller/init.rb).

Here are the steps to reproduce the problem:

  1. Start the development server. I'm using Thin.
  2. Visit one of the actions in the app. So far I have '/', '/about', and '/signup'. The template for the action will be rendered correctly.
  3. Visit a different action. This time the exact same thing which was rendered for the first action will be returned.

Only the first request after starting the dev server will be rendered correctly.

I only think it has something to do with Haml because after switching back to the default engine for Ramaze, everything works as it should. All of my gems are up to date.

Any ideas?

Thank you!


Solution

  • Fixed it by reverting some supposed improvements to the way Ramaze handles Haml views. It would cache the result of the layout even though the @content variable changed. I also added a spec so this can't happen in the future: spec/ramaze/view/haml.rb