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