removed account destroy

This commit is contained in:
Mark Moser 2016-09-28 22:15:37 -05:00
parent 81c667da0f
commit 2a10a93ac9
4 changed files with 1 additions and 15 deletions

View File

@ -40,11 +40,6 @@ class AccountsController < ApplicationController
end end
end end
def destroy
@account.destroy
redirect_to accounts_url, notice: 'Account was successfully destroyed.'
end
private private
def set_account def set_account

View File

@ -25,6 +25,5 @@
<%= @account.contact_email %> <%= @account.contact_email %>
</p> </p>
<%= link_to 'Destroy', @account, method: :delete, data: { confirm: 'Are you sure?' } %>
<%= link_to 'Edit', edit_account_path(@account) %> | <%= link_to 'Edit', edit_account_path(@account) %> |
<%= link_to 'Back', accounts_path %> <%= link_to 'Back', accounts_path %>

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
Rails.application.routes.draw do Rails.application.routes.draw do
get 'accounts/reveal/:id', to: 'accounts#reveal', as: :reveal_password get 'accounts/reveal/:id', to: 'accounts#reveal', as: :reveal_password
resources :accounts resources :accounts, except: [:destroy]
get "logout", to: "auth#logout", as: :logout get "logout", to: "auth#logout", as: :logout
get "login", to: "auth#login", as: :login get "login", to: "auth#login", as: :login

View File

@ -50,12 +50,4 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
assert_response :success assert_response :success
assert_match(/failed to update/i, flash[:error]) assert_match(/failed to update/i, flash[:error])
end end
test "should destroy account" do
assert_difference('Account.count', -1) do
delete account_url(@account)
end
assert_redirected_to accounts_url
end
end end