Class: Ishapi::TagsController
Instance Method Summary
collapse
#home, #long_term_token, #vote
Instance Method Details
#index ⇒ Object
5
6
7
8
9
10
11
12
|
# File 'app/controllers/ishapi/tags_controller.rb', line 5
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
|
#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( slug: params[:slug] )
rescue Mongoid::Errors::DocumentNotFound
@tag = Tag.find params[:slug]
end
authorize! :show, @tag
end
|