Class: Admin::TagsController

Inherits:
ResourceController
  • Object
show all
Defined in:
app/controllers/admin/tags_controller.rb

Instance Method Summary collapse

Instance Method Details

#cloudObject



18
19
20
21
# File 'app/controllers/admin/tags_controller.rb', line 18

def cloud
  @tags = Tag.sized(Tag.with_count).sort
  response_for :plural
end

#indexObject



4
5
6
7
8
9
10
11
12
# File 'app/controllers/admin/tags_controller.rb', line 4

def index
  tags = params[:query] ? Tag.suggested_by(params[:query]) : Tag.with_count
  @tags = tags.sort
  respond_to do |wants|
    wants.xml { render :xml => @tags }
    wants.json { render :json => { 'query' => params[:query], 'suggestions' => @tags.map(&:title) } }
    wants.any
  end
end

#showObject



14
15
16
# File 'app/controllers/admin/tags_controller.rb', line 14

def show
  @tag = load_model
end