ActionView::TemplateMissing error in Rails 4 when rendering shared errors -
i'm learning rails , implementing app decided go through site point tutorial.
according it, i've done following in apps/views/users/new.html.erb
<%= form_for @user |f| %> <%= render 'shared/errors', object: @user %> #=> error <div class="form-group"> <%= f.label :name %> <%= f.text_field :name, placeholder: 'your display name', class: 'form-control', required: true %> </div> <% end %>
but i'm getting
actioncontroller:missingtemplate
inusers#new
how can rid of it? i've posted full trace here
the tutorial you're following assumes have _errors.html.erb
file in app/views/shared
directory.
<%= render 'shared/errors', object: @user %>
that line of code trying render partial , pass @user
used in partial.
if want remove error remove line of code. if want display errors create relevant file , read on how display errors in view.
Comments
Post a Comment