Sha256: f40f9573ebec5afdf40ebabc62cf9a93e3ea72a4797abceb48d55c213fc04d06

Contents?: true

Size: 717 Bytes

Versions: 13

Compression:

Stored size: 717 Bytes

Contents

format do
  def search_params
    @search_params ||= default_search_params
  end

  # used for override
  def default_search_params
    if (qparams = query_params)
      paging_params.merge vars: qparams
    else
      paging_params
    end
  end

  def paging_params
    { limit: limit, offset: offset }
  end

  def query_params
    return nil unless (vars = params[:query])

    Env.hash vars
  end

  def default_limit
    100
  end

  def extra_paging_path_args
    (vars = query_params) ? { query: vars } : {}
  end
end

format :html do
  def default_limit
    Cardio.config.paging_limit || 20
  end
end

format :json do
  def default_limit
    20
  end
end

format :rss do
  def default_limit
    25
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
card-mod-search-0.14.2 set/abstract/02_search_params.rb
card-mod-search-0.14.1 set/abstract/02_search_params.rb
card-mod-search-0.14.0 set/abstract/02_search_params.rb
card-mod-search-0.13.4 set/abstract/02_search_params.rb
card-mod-search-0.13.3 set/abstract/02_search_params.rb
card-mod-search-0.13.2 set/abstract/02_search_params.rb
card-mod-search-0.13.1 set/abstract/02_search_params.rb
card-mod-search-0.13.0 set/abstract/02_search_params.rb
card-mod-search-0.11.7 set/abstract/02_search_params.rb
card-mod-search-0.12.0 set/abstract/02_search_params.rb
card-mod-search-0.11.6 set/abstract/02_search_params.rb
card-mod-search-0.11.5 set/abstract/02_search_params.rb
card-mod-search-0.11.4 set/abstract/02_search_params.rb