I am getting a ActionView::MissingTemplate in Users#show error in my app.
I have the following code, which renders a partial (html section that is repeated across multiple pages) called _meta.html.erb. This file is in app/views/users/_meta.html.erb and contains the following code:
<%= image_tag("user_pic.png", alt: @user.name, :class => "profile_pic" ) %>
</br>
<h2 class="user_profile"><%= @user.name %> <%= @user.surname %></h2>
<h3 class="user_location"><%= @user.city %>, <%= @user.state %></h3>
...
My users#show code as the following:
<div id="leftbar">
<%= render '_meta' %>
</div>
I have tried <%= render '/_meta' %>, <%= render 'users/_meta' %>, <%= render '/users/_meta' %>, etc. but nothing seems to be working.
This is probably a Noob error, but I’m stuck. Any thoughts?
Use
render 'meta'. You don’t need to add_to the partial name. Here is a guide about rendering in Rails.