Render partial from sub-directory

haml, ruby-on-rails

Solution

Use the full path in the render method.

For example, if you have the following directory structure ...

app | views |--» landing |----» main_template.html.erb |----» desktop |------» _home.html.erb |----» mobile |------» _home.html.erb

... and `main_template` which calls render is found under`app/views/landing`, then calls to render would look like this ... `render partial: 'landing/desktop/home'` `render partial: 'landing/mobile/home'`

Problem

My views directory is structured as follows: view - by domain - domain1 - user_mailer - nav - _menu.html.haml - apply.html.haml - welcome.html.haml Is there a way to render the partial from apply.html.haml without specifying the full path? I read somewhere else I could do `render :partial => "./nav/menu"` but it isn't working for me.

Original source