Extract setting content types form to a component

This commit is contained in:
Senén Rodero Rodríguez
2023-11-27 10:19:58 +01:00
committed by Javi Martín
parent 57c257e91c
commit c9e3b8903d
3 changed files with 9 additions and 1 deletions

View File

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

View File

@@ -17,7 +17,7 @@
</td>
<td class="small-6">
<% if setting.content_type? %>
<%= render "admin/settings/content_types_settings_form", setting: setting %>
<%= render Admin::Settings::ContentTypesFormComponent.new(setting) %>
<% else %>
<% if defined?(tab) %>
<%= render "admin/settings/settings_form", setting: setting, tab: tab %>