Class: Ishapi::TagsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Ishapi::TagsController
- Defined in:
- app/controllers/ishapi/tags_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'app/controllers/ishapi/tags_controller.rb', line 5 def index :index, Tag @tags = Tag.all if params[:domain] @site = Site.find_by( :domain => params[:domain], :lang => :en ) @tags = @tags.where( :site => @site ) end end |
#show ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'app/controllers/ishapi/tags_controller.rb', line 14 def show begin @tag = Tag.find_by( :name_seo => params[:tagname] ) rescue Mongoid::Errors::DocumentNotFound @tag = Tag.find params[:tagname] end :show, @tag end |