:template not found in merb-core 0.9.1

In merb-core 0.9.1 render :template works in a slightly unexpected way. When using the :template option the :format is ignored in finding the correct template.

render :template => "/upload/form", :format => :html

The above will match the templates approot/app/views/upload/form.{erb,haml}

The quick fix for this is to put the format in the :template string…

render :template => "/upload/form.html"

Which will match approot/app/views/upload/form.html.{erb,haml}

Take a look yourself in merb-core 0.9.1 render.rb#278

March 13 2008 06:36 am | Merb

2 Responses to “:template not found in merb-core 0.9.1”

  1. Bakki on 20 Mar 2008 at 7:49 pm #

    I am having no luck with haml at all. It worked perfectly in 0.5x but after updating to 0.91 I just cannot get it to work.
    I have put in init.rb
    dependencies “merb-haml”, “merb_helpers”
    I have an applictation.html.haml layout and and index.html.haml action view. I tried without .html in the file names but no luck. I get nothing in the browser or the logs. Just a blank page.

    I tried the trick above which also did not work.

    Any ideas?

  2. henry on 21 Mar 2008 at 11:39 am #

    Hi Bakki,

    Seems to be working ok for me. Using the gems haml 1.8.2 and merb-haml 0.9.1.

    Make sure haml is in your Merb::Template::EXTENSIONS.

Trackback URI | Comments RSS

Leave a Reply