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.5 kB

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

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