Sha256: c9fc3957e4a20cb92b4dde95125c46a4cc7d0d3fa6416b6e65d609324722bedb

Contents?: true

Size: 776 Bytes

Versions: 15

Compression:

Stored size: 776 Bytes

Contents

class CommentsController < ApplicationController
  load_and_authorize_resource
  
  def show
    time = Time.at(params[:after].to_i + 1)
    @post = Post.where("comment_id = ? and created_at > ?",@comment.id,time)
  end
  
  def open
    @comment = Comment.find(params[:id])
    @comment.open=1
    @comment.save
    redirect_to :back
  end
  
  def close
    @comment = Comment.find(params[:id])
    @comment.open = false
    @comment.save
    redirect_to :back
  end

  def new
    @comment = Comment.new
    @comment.commentable_id = params[:id]
    @comment.open = true
    @comment.commentable_type = params[:type]
    @comment.save
    redirect_to :back
  end

  def remove
    @comment = Comment.find(params[:id])
    @comment.destroy
    redirect_to :back  
  end
end

Version data entries

15 entries across 8 versions & 1 rubygems

Version Path
squeezer-0.2.1 lib/generators/squeezer/templates/app/controllers/comments_controller.rb
squeezer-0.2.1 app/controllers/comments_controller.rb
squeezer-0.2.0 lib/generators/squeezer/templates/app/controllers/comments_controller.rb
squeezer-0.2.0 app/controllers/comments_controller.rb
squeezer-0.1.11 app/controllers/comments_controller.rb
squeezer-0.1.11 lib/generators/squeezer/templates/app/controllers/comments_controller.rb
squeezer-0.1.7 lib/generators/squeezer/templates/app/controllers/comments_controller.rb
squeezer-0.1.7 app/controllers/comments_controller.rb
squeezer-0.1.6 app/controllers/comments_controller.rb
squeezer-0.1.6 lib/generators/squeezer/templates/app/controllers/comments_controller.rb
squeezer-0.1.5 lib/generators/squeezer/templates/app/controllers/comments_controller.rb
squeezer-0.1.5 app/controllers/comments_controller.rb
squeezer-0.1.4 lib/generators/squeezer/templates/app/controllers/comments_controller.rb
squeezer-0.1.4 app/controllers/comments_controller.rb
squeezer-0.1.3 lib/app/controllers/comments_controller.rb