forked from xponrails/sunspot_autocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
18 additions
and
6,352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Sunspot Autocomplete - A Ruby on Rails plugin | ||
Sunspot Autocomplete - A Ruby on Rails gem | ||
|
||
Copyright (c) 2010 Haitham Mohammad | ||
Copyright (c) 2012 Stefano Mancini <[email protected]> | ||
|
||
Dual licensed under the MIT and GPL licenses: | ||
http://www.opensource.org/licenses/mit-license.php | ||
http://www.gnu.org/licenses/gpl.html | ||
http://www.gnu.org/licenses/gpl.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,11 +17,9 @@ http://outoftime.github.com/sunspot | |
|
||
== Installation | ||
|
||
Download the plugin and place it under vendor/plugins. | ||
gem "sunspot_autocomplete", ">= 0.0.3", :git => "[email protected]:xponrails/sunspot_autocomplete.git" | ||
|
||
Run the following rake task to copy the plugin's assets to your public directory. This will copy jquery.js and solr-autocompleter to your public/javascripts. | ||
|
||
rake sunspot_autocomplete:copy_assets | ||
Copy the gem's assets to your assets directory. | ||
|
||
== Usage | ||
|
||
|
@@ -64,28 +62,27 @@ To be able to autocomplete/autosuggest a model's attribute, call 'autocomplete'/ | |
end | ||
end | ||
|
||
In your view, Add the following script tags (in the given order) to be able to use the view helpers. | ||
In your application.js, Add the following lines. | ||
|
||
<script type="text/javascript" src="/javascripts/jquery.js"></script> | ||
<script type="text/javascript" src="/javascripts/solr-autocomplete/ajax-solr/core/Core.js"></script> | ||
<script type="text/javascript" src="/javascripts/solr-autocomplete/ajax-solr/core/AbstractManager.js"></script> | ||
<script type="text/javascript" src="/javascripts/solr-autocomplete/ajax-solr/managers/Manager.jquery.js"></script> | ||
<script type="text/javascript" src="/javascripts/solr-autocomplete/ajax-solr/core/Parameter.js"></script> | ||
<script type="text/javascript" src="/javascripts/solr-autocomplete/ajax-solr/core/ParameterStore.js"></script> | ||
<script type="text/javascript" src="/javascripts/solr-autocomplete/jquery-autocomplete/jquery.autocomplete.js"></script> | ||
//= require solr-autocomplete/ajax-solr/core/Core | ||
//= require solr-autocomplete/ajax-solr/core/AbstractManager | ||
//= require solr-autocomplete/ajax-solr/managers/Manager.jquery | ||
//= require solr-autocomplete/ajax-solr/core/Parameter | ||
//= require solr-autocomplete/ajax-solr/core/ParameterStore | ||
//= require solr-autocomplete/jquery-autocomplete/jquery.autocomplete | ||
|
||
Also, add the following stylesheet to use the basic style included. Alternatively, you can override those style rules to force your design's look and feel. | ||
Also, add the following line in your application.css to use the basic style included. Alternatively, you can override those style rules to force your design's look and feel. | ||
|
||
<link type="text/css" rel="stylesheet" href="/javascripts/solr-autocomplete/jquery-autocomplete/jquery.autocomplete.css" /> | ||
*= require solr-autocomplete/jquery.autocomplete | ||
|
||
In your view, to create a text field with autocomplete: | ||
|
||
<%=autocomplete_text_field "post", "title", "http://127.0.0.1:8983/solr/", "post_title"%> | ||
<%= autocomplete_text_field "post", "title", "http://127.0.0.1:8983/solr/", "post_title"%> | ||
|
||
And to create a text field with autosuggest: | ||
|
||
<%=autosuggest_text_field "post", "author", "http://127.0.0.1:8983/solr/", "post_author"%> | ||
<%= autosuggest_text_field "post", "author", "http://127.0.0.1:8983/solr/", "post_author"%> | ||
|
||
You can view documentation for more advanced features of the helpers. | ||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.