Sha256: f7c81066b35168064c70588c7317b8cc3e2cf528a3b1dd1e08bd6e727b04adb3

Contents?: true

Size: 559 Bytes

Versions: 36

Compression:

Stored size: 559 Bytes

Contents

require_dependency "ishapi/application_controller"
module Ishapi
  class TagsController < ApplicationController

    def index
      authorize! :index, Tag
      @tags = Tag.all
      if params[:domain]
        @site = Site.find_by( :domain => params[:domain], :lang => :en )
        @tags = @tags.where( :site => @site )
      end
    end

    def show
      begin
        @tag = Tag.find_by( slug: params[:slug] )
      rescue Mongoid::Errors::DocumentNotFound
        @tag = Tag.find params[:slug]
      end
      authorize! :show, @tag
    end

  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ishapi-0.1.8.194 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.193 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.192 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.191 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.190 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.189 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.188 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.187 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.185 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.184 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.183 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.182 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.181 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.180 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.178 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.177 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.176 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.175 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.174 app/controllers/ishapi/tags_controller.rb
ishapi-0.1.8.173 app/controllers/ishapi/tags_controller.rb