Move server rule creation form to its own page (#34637)

This commit is contained in:
Claire 2025-05-14 11:43:07 +02:00 committed by GitHub
parent c45ce549af
commit aa04efb92a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 27 additions and 16 deletions

View file

@ -2,13 +2,17 @@
module Admin
class RulesController < BaseController
before_action :set_rule, except: [:index, :create]
before_action :set_rule, except: [:index, :new, :create]
def index
authorize :rule, :index?
@rules = Rule.ordered
@rule = Rule.new
end
def new
authorize :rule, :create?
@rule = Rule.new
end
def edit
@ -24,7 +28,7 @@ module Admin
redirect_to admin_rules_path
else
@rules = Rule.ordered
render :index
render :new
end
end