Sha256: 18e1b84972dcbe61ca195197772262c63c9ab341b013efc3c4de2b4b8232b83c

Contents?: true

Size: 774 Bytes

Versions: 11

Compression:

Stored size: 774 Bytes

Contents

class Kaui::TagsController < Kaui::EngineController

  def index
  end

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

Version data entries

11 entries across 11 versions & 1 rubygems

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