Skip to content

Commit

Permalink
added error messages to paper createnpage, solved #25
Browse files Browse the repository at this point in the history
  • Loading branch information
akuchinke committed Nov 9, 2017
1 parent 2882a4b commit 5d2b17c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/views/papers/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<h1>new paper</h1>

<% if @author.errors.any? %>
<p>An error occured</p>

<ul>
<% @author.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
<% end %>
<%= form_for :paper, url: papers_path do |f| %>
<p>
<%= f.label :title %><br>
Expand Down

0 comments on commit 5d2b17c

Please sign in to comment.