Class: Kaui::CustomFieldsController
Instance Method Summary
collapse
#current_ability, #current_user, #options_for_klient
Instance Method Details
#index ⇒ Object
3
4
|
# File 'app/controllers/kaui/custom_fields_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
|
# File 'app/controllers/kaui/custom_fields_controller.rb', line 6
def
search_key = params[:sSearch]
offset = params[:iDisplayStart] || 0
limit = params[:iDisplayLength] || 10
custom_fields = Kaui::CustomField.list_or_search(search_key, offset, limit, options_for_klient)
json = {
:sEcho => params[:sEcho],
:iTotalRecords => custom_fields.,
:iTotalDisplayRecords => custom_fields.,
:aaData => []
}
custom_fields.each do |custom_field|
json[:aaData] << [
custom_field.name,
custom_field.value
]
end
respond_to do |format|
format.json { render :json => json }
end
end
|