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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user