removed account destroy
This commit is contained in:
parent
81c667da0f
commit
2a10a93ac9
@ -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
|
||||||
|
@ -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 %>
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user