Sha256: 8dd7578b13193c4a2d474dd85b7f2666785130ee2a1b2d95b5ae817202de3c1a

Contents?: true

Size: 804 Bytes

Versions: 24

Compression:

Stored size: 804 Bytes

Contents

class Admin::CommentsController < Admin::BaseController
  unloadable
  sortable_attributes :created_at, :name, :comment

  def index

    case
    when params[:article_id]
      @commentable = Article.find_by_id( params[:article_id] )
      @comments = @commentable.comments.paginate :page => params[:page], :order => sort_order
    else
      @comments = Comment.paginate :page => params[:page], :order => sort_order
    end

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @articles }
    end
  end

  def destroy
    @comment = Comment.find(params[:id])
    @comment.destroy
    flash[:notice] = 'Comment was successfully deleted.'

    respond_to do |format|
      format.html { redirect_to( :back ) }
      format.xml  { head :ok }
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
beef-articles-0.3.10 app/controllers/admin/comments_controller.rb
beef-articles-0.3.11 app/controllers/admin/comments_controller.rb
beef-articles-0.3.12 app/controllers/admin/comments_controller.rb
beef-articles-0.3.13 app/controllers/admin/comments_controller.rb
beef-articles-0.3.14 app/controllers/admin/comments_controller.rb
beef-articles-0.3.15 app/controllers/admin/comments_controller.rb
beef-articles-0.3.16 app/controllers/admin/comments_controller.rb
beef-articles-0.3.18 app/controllers/admin/comments_controller.rb
beef-articles-0.3.21 app/controllers/admin/comments_controller.rb
beef-articles-0.3.25 app/controllers/admin/comments_controller.rb
beef-articles-0.3.27 app/controllers/admin/comments_controller.rb
beef-articles-0.3.28 app/controllers/admin/comments_controller.rb
beef-articles-0.3.29 app/controllers/admin/comments_controller.rb
beef-articles-0.3.30 app/controllers/admin/comments_controller.rb
beef-articles-0.3.32 app/controllers/admin/comments_controller.rb
beef-articles-0.3.33 app/controllers/admin/comments_controller.rb
beef-articles-0.3.34 app/controllers/admin/comments_controller.rb
beef-articles-0.3.4 app/controllers/admin/comments_controller.rb
beef-articles-0.3.5 app/controllers/admin/comments_controller.rb
beef-articles-0.3.6 app/controllers/admin/comments_controller.rb