Sha256: 5d2a38824e0bc719bf5b060c1c0e5b1194698294fe6b351e1b18ba47903be4fd

Contents?: true

Size: 896 Bytes

Versions: 1

Compression:

Stored size: 896 Bytes

Contents

class Admin::TagsController < Admin::BaseController
  
  cache_sweeper :blog_sweeper

  def index
    if params[:order] and params[:order] =~ /\A(?:name|display_name|article_counter)\Z/
      if params[:sense] and params[:sense] == 'desc'
        order = params[:order] + " asc"
      else
        order = params[:order] + " desc"
      end
    else
      order = 'display_name ASC'
    end

    @tags = Tag.paginate(:page => params[:page], :order => :display_name, :per_page => this_blog.admin_display_elements)
  end
  
  def edit
    @tag = Tag.find(params[:id])
    @tag.attributes = params[:tag]

    if request.post? and @tag.save
      flash[:notice] = _('Tag was successfully updated.')
      redirect_to :action => 'index'
    end
  end
    
  def destroy
    @tag = Tag.find(params[:id])
    if request.post?
      @tag.destroy
      redirect_to :action => 'index'
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
typo-5.4 app/controllers/admin/tags_controller.rb