Fix edit and update actions

This commit is contained in:
Senén Rodero Rodríguez
2017-08-14 15:39:58 +02:00
parent e9c5f77368
commit f226d2ac94
6 changed files with 17 additions and 9 deletions

View File

@@ -25,7 +25,7 @@ class ProposalsController < ApplicationController
def create
@proposal = Proposal.new(proposal_params.merge(author: current_user))
@proposal = parse_documents(@proposal)
parse_documents(@proposal)
if @proposal.save
redirect_to share_proposal_path(@proposal), notice: I18n.t('flash.actions.create.proposal')
@@ -78,7 +78,7 @@ class ProposalsController < ApplicationController
def proposal_params
params.require(:proposal).permit(:title, :question, :summary, :description, :external_url, :video_url,
:responsible_name, :tag_list, :terms_of_service, :geozone_id,
documents_attributes: [:cached_attachment, :title] )
documents_attributes: [:id, :title, :attachment, :cached_attachment ] )
end
def retired_params