Make Banners translatable

This commit is contained in:
Marko Lovic
2018-07-27 14:57:49 +02:00
committed by María Checa
parent bfd9032e9d
commit 0fa4b60f39
7 changed files with 203 additions and 14 deletions

View File

@@ -1,4 +1,5 @@
class Admin::BannersController < Admin::BaseController
include Translatable
has_filters %w{all with_active with_inactive}, only: :index
@@ -41,7 +42,7 @@ class Admin::BannersController < Admin::BaseController
:post_started_at, :post_ended_at,
:background_color, :font_color,
web_section_ids: []]
params.require(:banner).permit(*attributes)
params.require(:banner).permit(*attributes, *translation_params(params[:banner]))
end
def banner_styles
@@ -59,4 +60,13 @@ class Admin::BannersController < Admin::BaseController
def banner_sections
@banner_sections = WebSection.all
end
def resource
@banner = Banner.find(params[:id]) unless @banner
@banner
end
def resource_model
Banner
end
end