From 545e5c59412377e1a069e7f222453abb124e4d67 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Sat, 7 Jun 2014 09:22:13 +0800 Subject: [PATCH] ert --- app/controllers/notificationcomments_controller.rb | 14 +++++++------- app/views/contestnotifications/show.html.erb | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/controllers/notificationcomments_controller.rb b/app/controllers/notificationcomments_controller.rb index e0c5adf72..53563a530 100644 --- a/app/controllers/notificationcomments_controller.rb +++ b/app/controllers/notificationcomments_controller.rb @@ -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 diff --git a/app/views/contestnotifications/show.html.erb b/app/views/contestnotifications/show.html.erb index f333e0a4e..1a30a93e0 100644 --- a/app/views/contestnotifications/show.html.erb +++ b/app/views/contestnotifications/show.html.erb @@ -29,10 +29,10 @@
<%= textilizable(@contestnotification, :description) %>
- + <%#= link_to_attachments @contestnotification %>
- <% if @contestnotification.notificationcommentable? %> +

<%= toggle_link l(:label_comment_add), "add_notificationcomment_form", :focus => "notificationcomment_notificationcomments" %>

@@ -45,7 +45,7 @@ <%= submit_tag l(:button_add) %>

<% end %> - <% end %> + <% html_title @contestnotification.title -%> @@ -57,7 +57,7 @@

<%= l(:label_comment_plural) %>

- <% notificationcomments = @contestnotification.notificationcomments.reverse %> + <% notificationcomments = @notificationcomments.reverse %> <% notificationcomments.each do |notificationcomment| %> <% next if notificationcomment.new_record? %>