app/controllers/flyboy/task_comments_controller.rb in flyboy-0.0.5 vs app/controllers/flyboy/task_comments_controller.rb in flyboy-0.0.6

- old
+ new

@@ -1,17 +1,15 @@ #encoding: utf-8 module Flyboy class TaskCommentsController < ::Flyboy::ApplicationController def create - @task ||= Task.find(params[:task_id]) - @comment ||= @task.comments.new(task_comment_params) + @task ||= Task.find(params[:task_id]) + @task_comment ||= @task.comments.new(task_comment_params) - @comment.date = DateTime.now # TODO : Export to model ? - authorize! :update, @task - if @comment.save + if @task_comment.save redirect_to @task else render "flyboy/tasks/show" end end