Change Translatable interface
This commit is contained in:
@@ -41,8 +41,9 @@ class Admin::BannersController < Admin::BaseController
|
||||
attributes = [:title, :description, :target_url,
|
||||
:post_started_at, :post_ended_at,
|
||||
:background_color, :font_color,
|
||||
*translation_params(Banner),
|
||||
web_section_ids: []]
|
||||
params.require(:banner).permit(*attributes, *translation_params(params[:banner]))
|
||||
params.require(:banner).permit(*attributes)
|
||||
end
|
||||
|
||||
def banner_styles
|
||||
@@ -65,8 +66,4 @@ class Admin::BannersController < Admin::BaseController
|
||||
@banner = Banner.find(params[:id]) unless @banner
|
||||
@banner
|
||||
end
|
||||
|
||||
def resource_model
|
||||
Banner
|
||||
end
|
||||
end
|
||||
|
||||
@@ -47,9 +47,10 @@ class Admin::BudgetInvestmentMilestonesController < Admin::BaseController
|
||||
image_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]
|
||||
documents_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]
|
||||
attributes = [:title, :description, :publication_date, :budget_investment_id, :status_id,
|
||||
*translation_params(Budget::Investment::Milestone),
|
||||
image_attributes: image_attributes, documents_attributes: documents_attributes]
|
||||
|
||||
params.require(:budget_investment_milestone).permit(*attributes, translation_params(params[:budget_investment_milestone]))
|
||||
params.require(:budget_investment_milestone).permit(*attributes)
|
||||
end
|
||||
|
||||
def load_budget_investment
|
||||
@@ -64,10 +65,6 @@ class Admin::BudgetInvestmentMilestonesController < Admin::BaseController
|
||||
Budget::Investment::Milestone.find(params[:id])
|
||||
end
|
||||
|
||||
def resource_model
|
||||
Budget::Investment::Milestone
|
||||
end
|
||||
|
||||
def resource
|
||||
get_milestone
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@ class Admin::SiteCustomization::InformationTextsController < Admin::SiteCustomiz
|
||||
|
||||
def update
|
||||
content_params.each do |content|
|
||||
values = content[:values].slice(*translation_params(content[:values]))
|
||||
values = content[:values].slice(*translation_params(I18nContent))
|
||||
|
||||
unless values.empty?
|
||||
values.each do |key, value|
|
||||
@@ -43,7 +43,7 @@ class Admin::SiteCustomization::InformationTextsController < Admin::SiteCustomiz
|
||||
end
|
||||
|
||||
def resource
|
||||
resource_model.find(content_params[:id])
|
||||
I18nContent.find(content_params[:id])
|
||||
end
|
||||
|
||||
def content_params
|
||||
|
||||
Reference in New Issue
Block a user