Merge branch 'master' into user-recomendations

This commit is contained in:
Alberto
2017-09-05 11:31:05 +02:00
committed by GitHub
58 changed files with 1955 additions and 51 deletions

View File

@@ -19,11 +19,13 @@ class ProposalsController < ApplicationController
def show
super
@notifications = @proposal.notifications
@document = Document.new(documentable: @proposal)
redirect_to proposal_path(@proposal), status: :moved_permanently if request.path != proposal_path(@proposal)
end
def create
@proposal = Proposal.new(proposal_params.merge(author: current_user))
recover_documents_from_cache(@proposal)
if @proposal.save
redirect_to share_proposal_path(@proposal), notice: I18n.t('flash.actions.create.proposal')
@@ -75,7 +77,8 @@ 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)
:responsible_name, :tag_list, :terms_of_service, :geozone_id,
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id] )
end
def retired_params
@@ -121,4 +124,5 @@ class ProposalsController < ApplicationController
def load_successful_proposals
@proposal_successful_exists = Proposal.successful.exists?
end
end