Fix upload settings redirection

This commit is contained in:
Senén Rodero Rodríguez
2023-11-27 11:54:15 +01:00
committed by Javi Martín
parent 1fb351425f
commit cb91a7421d
6 changed files with 19 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
<%= form_tag admin_update_content_types_path, method: :put, id: "edit_#{dom_id(setting)}" do %>
<%= hidden_field_tag "id", setting.id, id: dom_id(setting, :id) %>
<%= hidden_field_tag :tab, tab if tab %>
<div class="small-12 medium-6 large-8 column">
<% group = setting.content_type_group %>

View File

@@ -1,8 +1,9 @@
class Admin::Settings::ContentTypesFormComponent < ApplicationComponent
attr_reader :setting
attr_reader :setting, :tab
delegate :dom_id, to: :helpers
def initialize(setting)
def initialize(setting, tab: nil)
@setting = setting
@tab = tab
end
end

View File

@@ -17,7 +17,7 @@
</td>
<td>
<% if setting.content_type? %>
<%= render Admin::Settings::ContentTypesFormComponent.new(setting) %>
<%= render Admin::Settings::ContentTypesFormComponent.new(setting, tab: tab) %>
<% elsif setting.feature? %>
<%= render Admin::Settings::FeaturedSettingsFormComponent.new(setting, tab: tab) %>
<% else %>