Sfoglia il codice sorgente

Fix crash on updating Person

Maarten van den Berg 6 anni fa
parent
commit
93c017e8f6
1 ha cambiato i file con 2 aggiunte e 3 eliminazioni
  1. 2 3
      app/views/people/_form.html.erb

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

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