Move map_location attributes to concern

This commit is contained in:
taitus
2021-04-09 14:57:18 +02:00
parent 633be9f54e
commit c173568404
4 changed files with 13 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ class ProposalsController < ApplicationController
include CommentableActions
include FlagActions
include ImageAttributes
include MapLocationAttributes
include Translatable
before_action :load_categories, only: [:index, :new, :create, :edit, :map, :summary]
@@ -103,7 +104,7 @@ class ProposalsController < ApplicationController
image_attributes: image_attributes,
documents_attributes: [:id, :title, :attachment, :cached_attachment,
:user_id, :_destroy],
map_location_attributes: [:latitude, :longitude, :zoom]]
map_location_attributes: map_location_attributes]
translations_attributes = translation_params(Proposal, except: :retired_explanation)
params.require(:proposal).permit(attributes, translations_attributes)
end