Browse Source

Fix crash on updating Person

Maarten van den Berg 6 years ago
parent
commit
93c017e8f6
1 changed files with 2 additions and 3 deletions
  1. 2 3
      app/views/people/_form.html.erb

+ 2 - 3
app/views/people/_form.html.erb

1
-<% destination = 'new' if not defined? destination %>
2
-<%= form_for(person, url: {action: destination}) do |f| %>
1
+<%= form_for(person) do |f| %>
3
   <% if person.errors.any? %>
2
   <% if person.errors.any? %>
4
     <div id="error_explanation">
3
     <div id="error_explanation">
5
       <h2><%= pluralize(person.errors.count, "error") %> prohibited this person from being saved:</h2>
4
       <h2><%= pluralize(person.errors.count, "error") %> prohibited this person from being saved:</h2>
29
       <%= f.label :birth_date %>
28
       <%= f.label :birth_date %>
30
       <%= f.date_field :birth_date, type: 'date', class: 'form-control' %>
29
       <%= f.date_field :birth_date, type: 'date', class: 'form-control' %>
31
     </div>
30
     </div>
32
-    <% if not defined? no_admin %>
31
+    <% unless defined? no_admin %>
33
       <div class="form-group">
32
       <div class="form-group">
34
         <%= f.check_box :is_admin %>
33
         <%= f.check_box :is_admin %>
35
         <%= f.label :is_admin %>
34
         <%= f.label :is_admin %>