Add proposals translation interface

* Convert proposal form into translatable one.
 * Adapt translatable shared spec to define an owner when running at
   frontend feature specs.
 * Remove old attributes from strong parameters.
This commit is contained in:
Senén Rodero Rodríguez
2018-12-23 17:40:10 +01:00
committed by voodoorai2000
parent 4ce006ec96
commit bd3bb72370
5 changed files with 60 additions and 31 deletions

View File

@@ -1,6 +1,7 @@
class Management::ProposalsController < Management::BaseController
include HasOrders
include CommentableActions
include Translatable
before_action :only_verified_users, except: :print
before_action :set_proposal, only: [:vote, :show]
@@ -52,10 +53,10 @@ class Management::ProposalsController < Management::BaseController
end
def proposal_params
params.require(:proposal).permit(:title, :summary, :description, :video_url,
:responsible_name, :tag_list, :terms_of_service, :geozone_id,
:skip_map,
map_location_attributes: [:latitude, :longitude, :zoom])
attributes = [:video_url, :responsible_name, :tag_list,
:terms_of_service, :geozone_id,
:skip_map, map_location_attributes: [:latitude, :longitude, :zoom]]
params.require(:proposal).permit(attributes, translation_params(Proposal))
end
def resource_model