Class: WorldDbAdmin::TagsController
- Inherits:
-
WorldDbAdminController
- Object
- ActionController::Base
- WorldDbAdminController
- WorldDbAdmin::TagsController
- Defined in:
- app/controllers/world_db_admin/tags_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
GET /tags.
-
#shortcut ⇒ Object
GET /tag/:key e.g.
-
#show ⇒ Object
GET /tags/:id e.g.
Instance Method Details
#index ⇒ Object
GET /tags
8 9 10 11 |
# File 'app/controllers/world_db_admin/tags_controller.rb', line 8 def index ## fix: Tag.by_key must be key asc !! but is desc? why? fix it @tags = Tag.order('key asc').all end |
#shortcut ⇒ Object
GET /tag/:key e.g. /tag/euro or /tag/north_america
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/world_db_admin/tags_controller.rb', line 14 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 |
#show ⇒ Object
GET /tags/:id e.g. /tags/1
28 29 30 |
# File 'app/controllers/world_db_admin/tags_controller.rb', line 28 def show @tag = Tag.find( params[:id] ) end |