Move banner form partial to a component
Other than simplifying the controller, this'll make it easier to write tests for this code.
This commit is contained in:
15
app/components/admin/banners/form_component.rb
Normal file
15
app/components/admin/banners/form_component.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class Admin::Banners::FormComponent < ApplicationComponent
|
||||
include TranslatableFormHelper
|
||||
include GlobalizeHelper
|
||||
attr_reader :banner
|
||||
|
||||
def initialize(banner)
|
||||
@banner = banner
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def sections
|
||||
WebSection.all
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user