Sha256: 311a0c124dffe1197b2e8b49fc8bad3853b2efdef337a43bb407826c546e107a

Contents?: true

Size: 769 Bytes

Versions: 2

Compression:

Stored size: 769 Bytes

Contents

# encoding: utf-8

module WorldDbAdmin

class TagsController < WorldDbAdminController

  # GET /tags
  def index
    ## fix: Tag.by_key   must be  key asc !! but is desc? why? fix it
    @tags = Tag.order('key asc').all
  end
  
  # GET /tag/:key e.g. /tag/euro or /tag/north_america
  def shortcut
    @tag   = Tag.find_by_slug!( params[:key] )
    @order = params[:order] || 'title'

    ## magic parameter for dev -> generate yaml text template
    if params[:yml].present? || params[:yaml].present?
      render 'template.txt.erb', :layout => false, :content_type => 'text/plain'
      return
    end

    render :show
  end

  # GET /tags/:id e.g. /tags/1
  def show
    @tag = Tag.find( params[:id] )
  end

end # class TagsController

end  # module WorldDbAdmin

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
worlddb-admin-0.1.1 app/controllers/world_db_admin/tags_controller.rb
worlddb-admin-0.1.0 app/controllers/world_db_admin/tags_controller.rb