Class: Kaui::TagsController
Instance Method Summary
collapse
#current_ability, #current_user, #options_for_klient
Instance Method Details
#index ⇒ Object
3
4
|
# File 'app/controllers/kaui/tags_controller.rb', line 3
def index
end
|
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'app/controllers/kaui/tags_controller.rb', line 6
def
search_key = params[:sSearch]
offset = params[:iDisplayStart] || 0
limit = params[:iDisplayLength] || 10
tags = Kaui::Tag.list_or_search(search_key, offset, limit, options_for_klient)
json = {
:sEcho => params[:sEcho],
:iTotalRecords => tags.,
:iTotalDisplayRecords => tags.,
:aaData => []
}
tags.each do |tag|
json[:aaData] << [
tag.tag_id,
tag.object_type,
tag.tag_definition_name,
]
end
respond_to do |format|
format.json { render :json => json }
end
end
|