Merge author param into Proposal building at proposal controller create action
This commit is contained in:
@@ -23,11 +23,10 @@ class ProposalsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@proposal = Proposal.new(proposal_params)
|
@proposal = Proposal.new(proposal_params.merge(author: current_user))
|
||||||
@proposal.author = current_user
|
|
||||||
|
|
||||||
if @proposal.save
|
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
|
else
|
||||||
render :new
|
render :new
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user