Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing partial, but the file is there with the underscore in the name

I have a partial view called _footer.html.erb (I created only this file manually) in my app/views/layouts folder. In my app/views/layouts/application.html.erb file, I have:

    <%= render 'layouts/_footer.html.erb' %>

When I open the page, I get the following error:

Missing partial layouts/_footer.html.erb with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. Searched in:
  * "D:/rails/TestApp/app/views"

I've made some research and, as far as I understood, the only requirement is the underscore before the name. Did I miss something? I am following this tutorial

like image 614
JSBach Avatar asked Mar 17 '14 01:03

JSBach


1 Answers

Note the underscore and file extension are dropped from the filename _footer.html.erb.

Try this:

 <%= render 'layouts/footer' %>

see more here

like image 99
geoom Avatar answered Oct 24 '22 20:10

geoom