No partial, but the file has underlined in the title

I have a partial view called _footer.html.erb (I only created this file manually) in the app / views / layouts folder. In my application, app / views / layouts / application.html.erb 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" locale => [: en],: formats => [: html],: handlers => [: erb,: builder,: raw,: ruby,: jbuilder,: 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 did some research and, as I understand it, the only requirement is an underscore before the name. Did I miss something? I follow this tutorial

+6
source share
2 answers

Note that underscores and file extensions are removed from the _footer.html.erb file name.

Try the following:

  <%= render 'layouts/footer' %> 

See here for more details.

+10
source

You can try using the <%= render 'layouts/footer' %> , as in the use of partial characters that you do not use "_" character. You just visualize it using his name

+5
source

All Articles