Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Partials grouped in sub-folder

I have a view that relies on several partials. In wanting to group these partials, I moved them into a sub-folder but when I call the partial I get a Missing template client_demographics/_age.erb in view path app/views error.

My partials folder structure:

app
  views
    reports
      client_demographics
        _age.html.haml
        _gender.html.haml
      client_demographics.html.haml

How I am calling the partial in my view:

= render :partial => "client_demographics/age"
like image 537
Coderama Avatar asked Jul 29 '11 23:07

Coderama


1 Answers

You will need to use the path from the app/views folder

= render :partial => "reports/client_demographics/age"
like image 142
nowk Avatar answered Nov 14 '22 00:11

nowk