stores a proposal notification

This commit is contained in:
rgarcia
2016-06-01 13:30:44 +02:00
parent 1975018d6a
commit f5375e813d
14 changed files with 155 additions and 4 deletions

View File

@@ -0,0 +1,29 @@
class ProposalNotificationsController < ApplicationController
skip_authorization_check
def new
@notification = ProposalNotification.new
@proposal = Proposal.find(params[:proposal_id])
end
def create
@notification = ProposalNotification.new(notification_params)
@proposal = Proposal.find(notification_params[:proposal_id])
if @notification.save
redirect_to @notification, notice: I18n.t("flash.actions.create.proposal_notification")
else
render :new
end
end
def show
@notification = ProposalNotification.find(params[:id])
end
private
def notification_params
params.require(:proposal_notification).permit(:title, :body, :proposal_id)
end
end