Sha256: 089b40ce79991aa7b7f04ca8720a8dd2724b8479c6d53ec366662b40e45a29ae

Contents?: true

Size: 624 Bytes

Versions: 2

Compression:

Stored size: 624 Bytes

Contents

module Spree
  module Admin
    class QuestionsController < ResourceController

      def index
        respond_with(@collection) do |format|
          format.html
          format.json { render :json => json_data }
        end
      end

      protected

      def find_resource
        Question.find_by_slug!(params[:id])
      end

      def collection
        return @collection if @collection.present?
        params[:q] ||= {}
        params[:q][:s] ||= "created_at desc"
        @search = Spree::Question.search(params[:q])
        @collection = @search.result.page(params[:page]).per(20)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_grid_faq-0.1.0 app/controllers/spree/admin/questions_controller.rb
spree_grid_faq-0.0.9 app/controllers/spree/admin/questions_controller.rb