Extract setting content types form to a component
This commit is contained in:
committed by
Javi Martín
parent
57c257e91c
commit
c9e3b8903d
@@ -0,0 +1,8 @@
|
||||
class Admin::Settings::ContentTypesFormComponent < ApplicationComponent
|
||||
attr_reader :setting
|
||||
delegate :dom_id, to: :helpers
|
||||
|
||||
def initialize(setting)
|
||||
@setting = setting
|
||||
end
|
||||
end
|
||||
@@ -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 %>
|
||||
|
||||
Reference in New Issue
Block a user