From eee3b32b7714a302ae384c92ef13601167ec892a Mon Sep 17 00:00:00 2001
From: Yamagishi Kazutoshi <ykzts@desire.sh>
Date: Fri, 1 Dec 2017 20:26:57 +0900
Subject: [PATCH] Fix invites form path (#5861)

---
 app/controllers/admin/invites_controller.rb | 6 ++++++
 app/views/invites/_form.html.haml           | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/app/controllers/admin/invites_controller.rb b/app/controllers/admin/invites_controller.rb
index f4207e3e2d..607588d901 100644
--- a/app/controllers/admin/invites_controller.rb
+++ b/app/controllers/admin/invites_controller.rb
@@ -29,5 +29,11 @@ module Admin
       @invite.expire!
       redirect_to admin_invites_path
     end
+
+    private
+
+    def resource_params
+      params.require(:invite).permit(:max_uses, :expires_in)
+    end
   end
 end
diff --git a/app/views/invites/_form.html.haml b/app/views/invites/_form.html.haml
index 99647f5974..a01cf59461 100644
--- a/app/views/invites/_form.html.haml
+++ b/app/views/invites/_form.html.haml
@@ -1,4 +1,4 @@
-= simple_form_for(@invite) do |f|
+= simple_form_for(@invite, url: controller.is_a?(Admin::InvitesController) ? admin_invites_path : invites_path) do |f|
   = render 'shared/error_messages', object: @invite
 
   .fields-group
-- 
GitLab