Sha256: 6273fb90d4ff44053fc4ea77d6adb8d8538670ae3baee778b34c741586435f7c

Contents?: true

Size: 820 Bytes

Versions: 4

Compression:

Stored size: 820 Bytes

Contents

module Ecm
  module Tags
    class TagSearchsController < Ecm::Tags::Configuration.base_controller.constantize
      respond_to :html, :json

      def new
        @tag_search = TagSearch.new
        @result = {}
        respond_with @tag_search do |format|
          format.html
          format.json { render json: @tag_search }
        end
      end

      def create
        @tag_search = TagSearch.new(permitted_params)
        @result = @tag_search.result
        respond_with @tag_search do |format|
          format.html { render :new }
          format.json { render json: @tag_search }
        end
      end

      private

      def new_resource_path
        url_for(action: :new)
      end

      def permitted_params
        params.require(:tag_search).permit(:tag_list, :fuzzy)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ecm_tags-0.0.4 app/controllers/ecm/tags/tag_searchs_controller.rb
ecm_tags-0.0.3 app/controllers/ecm/tags/tag_searchs_controller.rb
ecm_tags-0.0.2 app/controllers/ecm/tags/tag_searchs_controller.rb
ecm_tags-0.0.1 app/controllers/ecm/tags/tag_searchs_controller.rb