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

@@ -3,8 +3,6 @@ class Admin::BannersController < Admin::BaseController
has_filters %w[all with_active with_inactive], only: :index
before_action :banner_sections, only: [:edit, :new, :create, :update]
respond_to :html, :js
load_and_authorize_resource
@@ -47,10 +45,6 @@ class Admin::BannersController < Admin::BaseController
web_section_ids: []]
end
def banner_sections
@banner_sections = WebSection.all
end
def resource
@banner ||= Banner.find(params[:id])
end