|
|
|
@ -6,12 +6,12 @@ class NotificationcommentsController < ApplicationController
|
|
|
|
|
before_filter :authorize
|
|
|
|
|
|
|
|
|
|
def create
|
|
|
|
|
raise Unauthorized unless @contestnotifications.notificationcommentable?
|
|
|
|
|
#raise Unauthorized unless @contestnotifications.notificationcommentable?
|
|
|
|
|
|
|
|
|
|
@notificaioncomment = Notificaioncomment.new
|
|
|
|
|
@notificaioncomment.safe_attributes = params[:notificaioncomment]
|
|
|
|
|
@notificaioncomment.author = User.current
|
|
|
|
|
if @contestnotifications.notificaioncomments << @notificaioncomment
|
|
|
|
|
@notificationcomment = Notificationcomment.new
|
|
|
|
|
@notificationcomment.safe_attributes = params[:notificationcomment]
|
|
|
|
|
@notificationcomment.author = User.current
|
|
|
|
|
if @contestnotifications.notificationcomments << @notificationcomment
|
|
|
|
|
flash[:notice] = l(:label_comment_added)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -19,7 +19,7 @@ class NotificationcommentsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
|
@contestnotifications.notificaioncomments.find(params[:notificaioncomment_id]).destroy
|
|
|
|
|
@contestnotifications.notificationcomments.find(params[:notificationcomment_id]).destroy
|
|
|
|
|
redirect_to contest_contestnotification_path(@contestnotifications)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -28,7 +28,7 @@ class NotificationcommentsController < ApplicationController
|
|
|
|
|
def find_model_object
|
|
|
|
|
super
|
|
|
|
|
@contestnotifications = @object
|
|
|
|
|
@notificaioncomment = nil
|
|
|
|
|
@notificationcomment = nil
|
|
|
|
|
@contestnotifications
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|