Explorar el Código

Save => create / update

Andrew hace 9 años
padre
commit
9e443bafef
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      app/views/blazer/queries/_form.html.erb

+ 1 - 1
app/views/blazer/queries/_form.html.erb

@@ -45,7 +45,7 @@
         <% if @query.persisted? %>
           <%= link_to "Delete", query_path(@query), method: :delete, "data-confirm" => "Are you sure?", class: "btn btn-danger" %>
         <% end %>
-        <%= f.submit "Save", class: "btn btn-success" %>
+        <%= f.submit @query.persisted? ? "Update" : "Create", class: "btn btn-success" %>
       </div>
     </div>
   </div>