Add debates translation interface

Also fix broken spec after removing translatable attributes from
strong_parameters definition. Now we need to send these attributes
as nested translations attributes.

Use activerecord.yml title attribute label so form helper could load it
from default location.
This commit is contained in:
Senén Rodero Rodríguez
2018-12-23 18:31:36 +01:00
committed by voodoorai2000
parent f77e7df33e
commit 51cda51155
6 changed files with 43 additions and 21 deletions

View File

@@ -2,6 +2,7 @@ class DebatesController < ApplicationController
include FeatureFlags
include CommentableActions
include FlagActions
include Translatable
before_action :parse_tag_filter, only: :index
before_action :authenticate_user!, except: [:index, :show, :map]
@@ -55,7 +56,8 @@ class DebatesController < ApplicationController
private
def debate_params
params.require(:debate).permit(:title, :description, :tag_list, :terms_of_service)
attributes = [:tag_list, :terms_of_service]
params.require(:debate).permit(attributes, translation_params(Debate))
end
def resource_model