Skip to content

Commit fa559b7

Browse files
committed
Add policy pundit
1 parent 6aa1ea3 commit fa559b7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

app/controllers/lists_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def update
4646

4747
def destroy
4848
@list = List.find(params[:id])
49+
4950
@list.destroy
5051
redirect_to root_path
5152
end

app/policies/list_policy.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ def index?
2121
def show?
2222
true
2323
end
24+
25+
def destroy?
26+
27+
end
2428
end

0 commit comments

Comments
 (0)