Merge author param into Proposal building at proposal controller create action

This commit is contained in:
Bertocq
2017-05-31 01:05:16 +02:00
parent a0bd158264
commit 438aaa65f6

View File

@@ -23,11 +23,10 @@ class ProposalsController < ApplicationController
end
def create
@proposal = Proposal.new(proposal_params)
@proposal.author = current_user
@proposal = Proposal.new(proposal_params.merge(author: current_user))
if @proposal.save
redirect_to share_proposal_path(@proposal), notice: I18n.t("flash.actions.create.proposal")
redirect_to share_proposal_path(@proposal), notice: I18n.t('flash.actions.create.proposal')
else
render :new
end