moved delete button away from submit button (duh), and changed delete a user to a POST request after realizing a spider might wreak havoc on that and delete all users
This commit is contained in:
@@ -27,6 +27,9 @@
|
||||
|
||||
<%= f.label :password_confirmation, nil, {:class => "control-label"}%>
|
||||
<%= f.password_field :password_confirmation, {:class => "span12", :placeholder => "Enter Password"} %>
|
||||
|
||||
<%= f.label :admin, nil, {:class => "control-label"}%>
|
||||
<%= f.select(:admin, @admin_select) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
@@ -36,7 +39,7 @@
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">
|
||||
Close
|
||||
</button>
|
||||
<%= link_to "Delete", "#", {:id => "delete_button", :class => "btn btn-danger"} %>
|
||||
<%= link_to "Delete", "#", {:id => "delete_button", :class => "btn btn-danger pull-left"} %>
|
||||
<%= f.submit "Submit", {:id => 'submit_button', :class => "btn btn-primary pull-right"} %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -69,7 +72,7 @@ $('#delete_button').click(function() {
|
||||
|
||||
$.ajax({
|
||||
url: "/admin/" + <%= @user.id %> + "/delete_user.json",
|
||||
type: "GET",
|
||||
type: "POST",
|
||||
success: function(response) {
|
||||
$('#success').show(500).delay(1500).fadeOut();
|
||||
loadTable();
|
||||
|
||||
Reference in New Issue
Block a user