You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

notificationcomments_controller.rb 1.1 kB

12 years ago
​
​
​
12 years ago
12 years ago
​
​
​
​
​
​
​
12 years ago
​
​
12 years ago
​
​
​
123456789101112131415161718192021222324252627
  1. class NotificationcommentsController < ApplicationController
  2. # default_search_scope :contestnotifications
  3. # model_object Contestnotifications
  4. # before_filter :authorize
  5. def create
  6. #raise Unauthorized unless @contestnotifications.notificationcommentable?
  7. @contest = Contest.find(params[:contest_id])
  8. @contestnotification = Contestnotification.find(params[:contestnotification_id])
  9. # @notificaioncomment = Notificationcomment.new
  10. # @notificaioncomment.safe_attributes = params[:notificationcomment]
  11. # @notificaioncomment.author = User.current
  12. comment = @contestnotification.notificationcomments.new(params[:notificationcomment].merge(author_id: User.current.id))
  13. if comment.save
  14. flash[:notice] = l(:label_comment_added)
  15. end
  16. redirect_to contest_contestnotification_path(@contest, @contestnotification)
  17. end
  18. def destroy
  19. @contestnotifications.notificaioncomments.find(params[:notificaioncomment_id]).destroy
  20. redirect_to contest_contestnotification_path(@contestnotifications)
  21. end
  22. end

软件技术创新是当今国家整体创新能力的重要基础和发展引擎。近年来,大众参与的软件创新与创业活动已经成为网络时代软件开发和应用的新形态,正在快速改变着全球软件创新模式和软件产业格局。 ...