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:
Javi Martín
2024-10-11 19:58:10 +02:00
parent 16fc9998c4
commit e850ae2ff9
5 changed files with 22 additions and 13 deletions

View 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