Sha256: 1e9be5cbcf795a32c26b7ad8409de1f9614273a771eaa5808cb1994e6f772b46

Contents?: true

Size: 453 Bytes

Versions: 4

Compression:

Stored size: 453 Bytes

Contents

class Admin::SearchController < AdminController
  include Admin::SearchControllerHelper
  respond_to :js, :html
  
  def index
    @results =  ThinkingSphinx.search params[:term], :match_mode => :extended, :star => true
    respond_to do |format|
      format.json { render request.format.to_sym => to_json_for_autocomplete( @results) }
      format.html { redirect_to url_for([:admin, @results.first]) if @results.length == 1 }
    end
  end
  

  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cable-0.9.17 app/controllers/admin/search_controller.rb
cable-0.9.16 app/controllers/admin/search_controller.rb
cable-0.9.15 app/controllers/admin/search_controller.rb
cable-0.9.14 app/controllers/admin/search_controller.rb