Sha256: 4b217342a727383ca04a7dbb06f99d8f22ee415ca2ed71dd1b2e7e22f6ef6cda

Contents?: true

Size: 465 Bytes

Versions: 2

Compression:

Stored size: 465 Bytes

Contents

module AnnotatorStore
  class PagesController < ApplicationController
    before_action :format_input, only: [:search]

    def index
    end

    def search
      @annotations = AnnotatorStore::Annotation.where(search_params)
      @total = @annotations.size
    end

    private

    def format_input
      params[:search] = {}
      params[:search][:uri] = params[:uri]
    end

    def search_params
      params.require(:search).permit(:uri)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
annotator_store-1.0.0 app/controllers/annotator_store/pages_controller.rb
annotator_store-1.0.0.pre app/controllers/annotator_store/pages_controller.rb