Sha256: de857d76368c4d6f006e6ec325fa763c0eff4df29d763920c348606951071097

Contents?: true

Size: 886 Bytes

Versions: 5

Compression:

Stored size: 886 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

5 entries across 5 versions & 1 rubygems

Version Path
typo-5.5 app/controllers/admin/tags_controller.rb
typo-5.4.4 app/controllers/admin/tags_controller.rb
typo-5.4.3 app/controllers/admin/tags_controller.rb
typo-5.4.2 app/controllers/admin/tags_controller.rb
typo-5.4.1 app/controllers/admin/tags_controller.rb