Add ability to reorder server rules from admin interface (#34737)
This commit is contained in:
parent
8ed0408adb
commit
d7cb6068b1
12 changed files with 97 additions and 2 deletions
|
@ -50,6 +50,22 @@ module Admin
|
|||
redirect_to admin_rules_path
|
||||
end
|
||||
|
||||
def move_up
|
||||
authorize @rule, :update?
|
||||
|
||||
@rule.move!(-1)
|
||||
|
||||
redirect_to admin_rules_path
|
||||
end
|
||||
|
||||
def move_down
|
||||
authorize @rule, :update?
|
||||
|
||||
@rule.move!(+1)
|
||||
|
||||
redirect_to admin_rules_path
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_rule
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue