diff --git a/app/controllers/help_center/support_threads_controller.rb b/app/controllers/help_center/support_threads_controller.rb index 6a07663..79bfb91 100644 --- a/app/controllers/help_center/support_threads_controller.rb +++ b/app/controllers/help_center/support_threads_controller.rb @@ -67,6 +67,6 @@ def set_support_thread end def support_thread_params - params.require(:support_thread).permit(:title, :content, :support_category_id, support_posts_attributes: [:body]) + params.require(:support_thread).permit(:title, :content, :position, :support_category_id, support_posts_attributes: [:body]) end end diff --git a/app/views/help_center/support_posts/_form.html.erb b/app/views/help_center/support_posts/_form.html.erb index 098a8f9..7d21b11 100644 --- a/app/views/help_center/support_posts/_form.html.erb +++ b/app/views/help_center/support_posts/_form.html.erb @@ -1,32 +1,47 @@ -<%= form_for [@support_thread, @support_post], - url: (@support_post.persisted? ? help_center.support_thread_support_post_path(@support_thread, @support_post) : help_center.support_thread_support_posts_path(@support_thread)), - html: { data: { behavior: "comment-form" } } do |f| %> - - <% if @support_post.errors.any? %> +<%= form_for @support_thread, + url: (@support_thread.persisted? ? help_center.support_thread_path(@support_thread) : help_center.support_threads_path), + html: { data: {behavior: "comment-form"} } do |f| %> + <% if @support_thread.errors.any? %>