Sha256: 7f7acb2609e22f8c39f5bf08d0cfde8dac244b664bf826a4abd643320218bb6d

Contents?: true

Size: 809 Bytes

Versions: 11

Compression:

Stored size: 809 Bytes

Contents

class Kaui::CustomFieldsController < Kaui::EngineController

  def index
  end

  def pagination
    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.pagination_max_nb_records,
        :iTotalDisplayRecords => custom_fields.pagination_total_nb_records,
        :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
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
kaui-0.11.0 app/controllers/kaui/custom_fields_controller.rb
kaui-0.10.0 app/controllers/kaui/custom_fields_controller.rb
kaui-0.9.0 app/controllers/kaui/custom_fields_controller.rb
kaui-0.8.4 app/controllers/kaui/custom_fields_controller.rb
kaui-0.8.3 app/controllers/kaui/custom_fields_controller.rb
kaui-0.8.2 app/controllers/kaui/custom_fields_controller.rb
kaui-0.8.1 app/controllers/kaui/custom_fields_controller.rb
kaui-0.8.0 app/controllers/kaui/custom_fields_controller.rb
kaui-0.7.2 app/controllers/kaui/custom_fields_controller.rb
kaui-0.7.1 app/controllers/kaui/custom_fields_controller.rb
kaui-0.7.0 app/controllers/kaui/custom_fields_controller.rb