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