|
|
@ -8,14 +8,14 @@ class NotificationcommentsController < ApplicationController
|
|
|
|
@contest = Contest.find(params[:contest_id])
|
|
|
|
@contest = Contest.find(params[:contest_id])
|
|
|
|
@contestnotification = Contestnotification.find(params[:contestnotification_id])
|
|
|
|
@contestnotification = Contestnotification.find(params[:contestnotification_id])
|
|
|
|
|
|
|
|
|
|
|
|
@notificaioncomment = Notificationcomment.new
|
|
|
|
# @notificaioncomment = Notificationcomment.new
|
|
|
|
@notificaioncomment.safe_attributes = params[:notificaioncomment]
|
|
|
|
# @notificaioncomment.safe_attributes = params[:notificationcomment]
|
|
|
|
@notificaioncomment.author = User.current
|
|
|
|
# @notificaioncomment.author = User.current
|
|
|
|
if @contestnotification.notificationcomments << @notificaioncomment
|
|
|
|
comment = @contestnotification.notificationcomments.new(params[:notificationcomment].merge(author_id: User.current.id))
|
|
|
|
|
|
|
|
if comment.save
|
|
|
|
flash[:notice] = l(:label_comment_added)
|
|
|
|
flash[:notice] = l(:label_comment_added)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#redirect_to contest_contestnotification_notificationcomment_path(@contest, @contestnotification, @notificaioncomment)
|
|
|
|
|
|
|
|
redirect_to contest_contestnotification_path(@contest, @contestnotification)
|
|
|
|
redirect_to contest_contestnotification_path(@contest, @contestnotification)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|