moved form errors to partial
This commit is contained in:
@ -1,17 +1,7 @@
|
||||
<main class="intro_tpl">
|
||||
<h1>New Candidate</h1>
|
||||
|
||||
<% if flash[:error].present? %>
|
||||
<div class="error">
|
||||
<%= flash[:error] %>
|
||||
<p>
|
||||
<% @candidate.errors.messages.each do |k,v| %>
|
||||
<%= "#{k.to_s} #{v.join(' and ')}" %><br />
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render partial: 'shared/form_model_errors', locals: { obj: @candidate } %>
|
||||
<%= form_for @candidate, url: create_candidate_path do |form| %>
|
||||
<div class="form-group">
|
||||
<%= form.label :name, "Candidate name" %>
|
||||
|
Reference in New Issue
Block a user