Merge author param into Proposal building at proposal controller create action
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user